/** * ** Writes the specified line to the specified socket's output stream ** @param socket The * socket which's output stream to write to ** @param val The line to write to the socket output * stream. A newline is ** appended if it does not already end with one. ** @throws IOException if * an error occurs */ protected static void socketWriteLine(Socket socket, String val) throws IOException { if (val != null) { String lineTerm = ClientSocketThread.getLineTerminator(); String v = val.endsWith(lineTerm) ? val : (val + lineTerm); ClientSocketThread.socketWriteBytes(socket, StringTools.getBytes(v), 0, -1); } }
/** * ** Writes the specified String to the specified socket's output stream ** @param socket The * socket which's output stream to write to ** @param val The String to write to the socket output * stream. ** @throws IOException if an error occurs */ protected static void socketWriteString(Socket socket, String val) throws IOException { if (val != null) { ClientSocketThread.socketWriteBytes(socket, StringTools.getBytes(val), 0, -1); } }