public void write(final DataOutputStream outputStream) throws IOException {
  if (service != null && service.length != 0) {
    outputStream.write((byte)service.length);
    outputStream.write(service);
  }
 else {
    outputStream.write((byte)0);
  }
  outputStream.writeShort((short)fileNameOffset);
  outputStream.writeShort((short)fileNameLen);
  outputStream.writeShort((short)threadNameOffset);
  outputStream.writeShort((short)threadNameLen);
  outputStream.write((byte)level);
  outputStream.writeShort((short)lineNumberOffset);
  outputStream.write((byte)lineNumberLen);
  outputStream.writeLong(time);
  outputStream.writeShort((short)timeBytesOffset);
  outputStream.write((byte)timeBytesLen);
  outputStream.writeShort((short)logOffset);
  byte[] combinedMsg=getRawLogContent();
  if (combinedMsg != null && combinedMsg.length != 0) {
    outputStream.writeInt(combinedMsg.length);
    outputStream.write(combinedMsg);
  }
 else {
    outputStream.writeInt(0);
  }
}

public void write ( final DataOutputStream outputStream ) throws IOException { if ( service != null && service . length != 0 ) { outputStream . write ( ( byte ) service . length ) ; outputStream . write ( service ) ; } else { outputStream . write ( ( byte ) 0 ) ; } outputStream . writeShort ( ( short ) fileNameOffset ) ; outputStream . writeShort ( ( short ) fileNameLen ) ; outputStream . writeShort ( ( short ) threadNameOffset ) ; outputStream . writeShort ( ( short ) threadNameLen ) ; outputStream . write ( ( byte ) level ) ; outputStream . writeShort ( ( short ) lineNumberOffset ) ; outputStream . write ( ( byte ) lineNumberLen ) ; outputStream . writeLong ( time ) ; outputStream . writeShort ( ( short ) timeBytesOffset ) ; outputStream . write ( ( byte ) timeBytesLen ) ; outputStream . writeShort ( ( short ) logOffset ) ; byte [ ] combinedMsg = getRawLogContent ( ) ; if ( combinedMsg != null && combinedMsg . length != 0 ) { outputStream . writeInt ( combinedMsg . length ) ; outputStream . write ( combinedMsg ) ; } else { outputStream . writeInt ( 0 ) ; } }
write the logmessage object to a dataoutputstream the serialized form of the object is : = = = = = = = = = = = = = start = = = = = = = = = = = = = = service length ( byte ) service ( byte [ ] ) file name offset ( short ) file name length ( short ) thread name offset ( short ) thread name length ( short ) level ( byte ) line number offset ( short ) line number length ( byte ) time ( long ) timebytes offset ( short ) timebytes length ( byte ) message offset ( short ) message length ( int ) message ( byte [ ] ) = = = = = = = = = = = = = = end = = = = = = = = = = = = = = = note that node id is set in lognetworkreader , which is above network serialization .
