/** * Send a command to the server. May also be used to send text data. * * @param command the command to send (as a plain String) * @param args the command arguments, may be {@code null} * @param includeSpace if {@code true}, add a space between the command and its arguments * @return the reply code * @throws IOException */ private int __sendCommand(String command, String args, boolean includeSpace) throws IOException { StringBuilder __commandBuffer = new StringBuilder(); __commandBuffer.append(command); if (args != null) { if (includeSpace) { __commandBuffer.append(' '); } __commandBuffer.append(args); } __commandBuffer.append(SocketClient.NETASCII_EOL); String message; _writer.write(message = __commandBuffer.toString()); _writer.flush(); fireCommandSent(command, message); __getReply(); return _replyCode; }