Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Server - Client exchanging Message Objects  RSS feed

Tomer Gal
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I'm writing a certain Server Client application and I'd like them to exchange messages by exchanging the following Message object :


public class Message implements Serializable {
String code;
String string;

String getCode() {
return ( code);
String getString() {
return ( string);

Message ( String code, String string ) {
this.code = code;
this.string = string;

public String toString() {
return( code + " - " + string );


Now my problem is that sending such an object will be large in size ( more than 10kb ).
What is the way to do it without it taking more than it should ?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!