private String interpretMessage(Message message,boolean displayHex) throws IOException {
  byte[] msgData=message.getData();
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  if (!displayHex) {
    return new String(msgData);
  }
 else {
    HexDump.dump(msgData,0,out,0);
    return new String(out.toByteArray());
  }
}

private String interpretMessage ( Message message , boolean displayHex ) throws IOException { byte [ ] msgData = message . getData ( ) ; ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; if ( ! displayHex ) { return new String ( msgData ) ; } else { HexDump . dump ( msgData , 0 , out , 0 ) ; return new String ( out . toByteArray ( ) ) ; } }
interprets the message to create a string representation
