public String printMessage(){
  StringBuffer sb=new StringBuffer();
  sb.append("Version: ");
  sb.append(version);
  sb.append("\n");
  if (data == null) {
    sb.append("Data: null");
  }
 else {
    sb.append("Data: {\n");
    sb.append(dumpHexBuffer(data,0,dataLength));
    sb.append("\n}\n");
  }
  return sb.toString();
}

public String printMessage ( ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( "Version: " ) ; sb . append ( version ) ; sb . append ( "\n" ) ; if ( data == null ) { sb . append ( "Data: null" ) ; } else { sb . append ( "Data: {\n" ) ; sb . append ( dumpHexBuffer ( data , 0 , dataLength ) ) ; sb . append ( "\n}\n" ) ; } return sb . toString ( ) ; }
dumps this message in a string .
