code: public void writeObject (Object object)
          throws IOException
      {
          // if the object to be written is null, simply write a zero
          if (object == null) {
              writeShort(0);
              return;
          }
  
          // otherwise, write the class mapping, then the bare object
          Class<?> sclass = Streamer.getStreamerClass(object);
          ClassMapping cmap = writeClassMapping(sclass);
          writeBareObject(object, cmap.streamer, true);
      }
docs: Writes a {@link Streamable} instance or one of the support object types to the output
  stream.