code: public LogRecordWriter writeObject(Object object) throws IOException {
          if( object==null) {
              return this.writeNullObject();
          }
          ObjectOutputStream out=null;
          try {
              ByteArrayOutputStream byteOutput= new ByteArrayOutputStream();
              out = new ObjectOutputStream(byteOutput);
              out.writeObject(object);
              out.flush();
              byte[] serBytes=byteOutput.toByteArray();
              io.writeInt(serBytes.length);
              io.write(serBytes);
          } finally {
              if(out!=null) {
                  IOUtils.closeQuietly(out);
              }
          }
          return this;
      }
docs: write the object's class name to check the consistency if the restroe fails.
  
  A null object is accepted
  
  @param object serializable object. it has to fullfill the requirements of {@link java.io.ObjectOutputStream#writeObject(Object)} .
  @return returns the fluent API
  @throws IOException