ChatClient.java
//User made new message => send to server
User made new message => send to server
User made new message = > send to server
public void newMessage(String message) throws IOException {
        buffer.clear();
        buffer.rewind();
        message += "\n";
        buffer.put(message.getBytes(StandardCharsets.UTF_8));
        buffer.flip();
        channel.write(buffer);
    }
public void newMessage ( String message ) throws IOException { buffer . clear ( ) ; buffer . rewind ( ) ; message += "\n" ; buffer . put ( message . getBytes ( StandardCharsets . UTF_8 ) ) ; buffer . flip ( ) ; channel . write ( buffer ) ; }
User made new message => send to server
User made new message = > send to server