code: public Object readObject ()
          throws IOException, ClassNotFoundException
      {
          try {
              // read the class mapping
              ClassMapping cmap = readClassMapping();
              if (cmap == null) {
                  if (STREAM_DEBUG) {
                      log.info(hashCode() + ": Read null.");
                  }
                  return null;
              }
  
              if (STREAM_DEBUG) {
                  log.info(hashCode() + ": Reading with " + cmap.streamer + ".");
              }
  
              // create an instance of the appropriate object
              Object target = cmap.streamer.createObject(this);
              readBareObject(target, cmap.streamer, true);
              return target;
  
          } catch (OutOfMemoryError oome) {
              throw (IOException)new IOException("Malformed object data").initCause(oome);
          }
      }
docs: Reads a {@link Streamable} instance or one of the supported object types from the input
  stream.