code: public Object readObject(Class cl)
          throws IOException
      {
          if (cl == null || cl == Object.class)
              return readObject();
  
          int tag = read();
  
          switch (tag) {
              case 'N':
                  return null;
  
              case 'M': {
                  String type = readType();
  
                  // hessian/3386
                  if ("".equals(type)) {
                      Deserializer reader;
                      reader = _serializerFactory.getDeserializer(cl);
  
                      return reader.readMap(this);
                  }
                  else {
                      Deserializer reader;
                      reader = _serializerFactory.getObjectDeserializer(type);
  
                      return reader.readMap(this);
                  }
              }
  
              case 'V': {
                  String type = readType();
                  int length = readLength();
  
                  Deserializer reader;
                  reader = _serializerFactory.getObjectDeserializer(type);
  
                  if (cl != reader.getType() && cl.isAssignableFrom(reader.getType()))
                      return reader.readList(this, length);
  
                  reader = _serializerFactory.getDeserializer(cl);
  
                  Object v = reader.readList(this, length);
  
                  return v;
              }
  
              case 'R': {
                  int ref = parseInt();
  
                  return _refs.get(ref);
              }
  
              case 'r': {
                  String type = readType();
                  String url = readString();
  
                  return resolveRemote(type, url);
              }
          }
  
          _peek = tag;
  
          // hessian/332i vs hessian/3406
          //return readObject();
  
          Object value = _serializerFactory.getDeserializer(cl).readObject(this);
  
          return value;
      }
docs: Reads an object from the input stream with an expected type.