Advertisement
Speedyyz

Untitled

Feb 13th, 2020
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public class MessageGui implements Message {
  2.  
  3.  
  4. private String text;
  5.  
  6.  
  7. @Override
  8. public void readFrom(ChannelBuf buf) {
  9.  
  10. text=buf.readUTF();
  11.  
  12.  
  13. }
  14.  
  15. @Override
  16. public void writeTo(ChannelBuf buf) {
  17.  
  18. buf.writeUTF(text);
  19.  
  20. }
  21.  
  22. public static class Handler implements MessageHandler<MessageGui>{
  23.  
  24. @Override
  25. public void handleMessage(MessageGui message, RemoteConnection connection, Platform.Type side) {
  26. System.out.println("works");
  27. System.out.println(message.text);
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement