@Test public void readObject() throws IOException { User user = (User) hessian2Input.readObject(User.class); }
public Object readObject(Class cl) throws IOException { if (cl == null || cl == Object.class) return readObject(); int tag = _offset < _length ? (_buffer[_offset++] & 0xff) : read(); switch (tag) { case 'N': return null; case 'H': { Deserializer reader = findSerializerFactory().getDeserializer(cl); return reader.readMap(this); } case 'M': { String type = readType(); if ("".equals(type)) { Deserializer reader; reader = findSerializerFactory().getDeserializer(cl); return reader.readMap(this); } else { Deserializer reader; reader = findSerializerFactory().getObjectDeserializer(type, cl); return reader.readMap(this); } } case 'C': { readObjectDefinition(cl); return readObject(cl); } case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: { int ref = tag - 0x60; int size = _classDefs.size(); if (ref < 0 || size <= ref) throw new HessianProtocolException("'" + ref + "' is an unknown class definition"); ObjectDefinition def = _classDefs.get(ref); return readObjectInstance(cl, def); } case 'O': { int ref = readInt(); int size = _classDefs.size(); if (ref < 0 || size <= ref) throw new HessianProtocolException("'" + ref + "' is an unknown class definition"); ObjectDefinition def = _classDefs.get(ref); return readObjectInstance(cl, def); } case BC_LIST_VARIABLE: { String type = readType(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readList(this, -1); return v; } case BC_LIST_FIXED: { String type = readType(); int length = readInt(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readLengthList(this, length); return v; } case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: { int length = tag - 0x70; String type = readType(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readLengthList(this, length); return v; } case BC_LIST_VARIABLE_UNTYPED: { Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readList(this, -1); return v; } case BC_LIST_FIXED_UNTYPED: { int length = readInt(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readLengthList(this, length); return v; } case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: { int length = tag - 0x78; Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readLengthList(this, length); return v; } case BC_REF: { int ref = readInt(); return _refs.get(ref); } } if (tag >= 0) _offset--; Object value = findSerializerFactory().getDeserializer(cl).readObject(this); return value; }
Hessian2Input extends AbstractHessianInput implements Hessian2Constants { public Object readObject(Class cl) throws IOException { if (cl == null || cl == Object.class) return readObject(); int tag = _offset < _length ? (_buffer[_offset++] & 0xff) : read(); switch (tag) { case 'N': return null; case 'H': { Deserializer reader = findSerializerFactory().getDeserializer(cl); return reader.readMap(this); } case 'M': { String type = readType(); if ("".equals(type)) { Deserializer reader; reader = findSerializerFactory().getDeserializer(cl); return reader.readMap(this); } else { Deserializer reader; reader = findSerializerFactory().getObjectDeserializer(type, cl); return reader.readMap(this); } } case 'C': { readObjectDefinition(cl); return readObject(cl); } case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: { int ref = tag - 0x60; int size = _classDefs.size(); if (ref < 0 || size <= ref) throw new HessianProtocolException("'" + ref + "' is an unknown class definition"); ObjectDefinition def = _classDefs.get(ref); return readObjectInstance(cl, def); } case 'O': { int ref = readInt(); int size = _classDefs.size(); if (ref < 0 || size <= ref) throw new HessianProtocolException("'" + ref + "' is an unknown class definition"); ObjectDefinition def = _classDefs.get(ref); return readObjectInstance(cl, def); } case BC_LIST_VARIABLE: { String type = readType(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readList(this, -1); return v; } case BC_LIST_FIXED: { String type = readType(); int length = readInt(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readLengthList(this, length); return v; } case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: { int length = tag - 0x70; String type = readType(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readLengthList(this, length); return v; } case BC_LIST_VARIABLE_UNTYPED: { Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readList(this, -1); return v; } case BC_LIST_FIXED_UNTYPED: { int length = readInt(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readLengthList(this, length); return v; } case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: { int length = tag - 0x78; Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readLengthList(this, length); return v; } case BC_REF: { int ref = readInt(); return _refs.get(ref); } } if (tag >= 0) _offset--; Object value = findSerializerFactory().getDeserializer(cl).readObject(this); return value; } }
Hessian2Input extends AbstractHessianInput implements Hessian2Constants { public Object readObject(Class cl) throws IOException { if (cl == null || cl == Object.class) return readObject(); int tag = _offset < _length ? (_buffer[_offset++] & 0xff) : read(); switch (tag) { case 'N': return null; case 'H': { Deserializer reader = findSerializerFactory().getDeserializer(cl); return reader.readMap(this); } case 'M': { String type = readType(); if ("".equals(type)) { Deserializer reader; reader = findSerializerFactory().getDeserializer(cl); return reader.readMap(this); } else { Deserializer reader; reader = findSerializerFactory().getObjectDeserializer(type, cl); return reader.readMap(this); } } case 'C': { readObjectDefinition(cl); return readObject(cl); } case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: { int ref = tag - 0x60; int size = _classDefs.size(); if (ref < 0 || size <= ref) throw new HessianProtocolException("'" + ref + "' is an unknown class definition"); ObjectDefinition def = _classDefs.get(ref); return readObjectInstance(cl, def); } case 'O': { int ref = readInt(); int size = _classDefs.size(); if (ref < 0 || size <= ref) throw new HessianProtocolException("'" + ref + "' is an unknown class definition"); ObjectDefinition def = _classDefs.get(ref); return readObjectInstance(cl, def); } case BC_LIST_VARIABLE: { String type = readType(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readList(this, -1); return v; } case BC_LIST_FIXED: { String type = readType(); int length = readInt(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readLengthList(this, length); return v; } case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: { int length = tag - 0x70; String type = readType(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readLengthList(this, length); return v; } case BC_LIST_VARIABLE_UNTYPED: { Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readList(this, -1); return v; } case BC_LIST_FIXED_UNTYPED: { int length = readInt(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readLengthList(this, length); return v; } case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: { int length = tag - 0x78; Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readLengthList(this, length); return v; } case BC_REF: { int ref = readInt(); return _refs.get(ref); } } if (tag >= 0) _offset--; Object value = findSerializerFactory().getDeserializer(cl).readObject(this); return value; } Hessian2Input();  Hessian2Input(InputStream is); }
Hessian2Input extends AbstractHessianInput implements Hessian2Constants { public Object readObject(Class cl) throws IOException { if (cl == null || cl == Object.class) return readObject(); int tag = _offset < _length ? (_buffer[_offset++] & 0xff) : read(); switch (tag) { case 'N': return null; case 'H': { Deserializer reader = findSerializerFactory().getDeserializer(cl); return reader.readMap(this); } case 'M': { String type = readType(); if ("".equals(type)) { Deserializer reader; reader = findSerializerFactory().getDeserializer(cl); return reader.readMap(this); } else { Deserializer reader; reader = findSerializerFactory().getObjectDeserializer(type, cl); return reader.readMap(this); } } case 'C': { readObjectDefinition(cl); return readObject(cl); } case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: { int ref = tag - 0x60; int size = _classDefs.size(); if (ref < 0 || size <= ref) throw new HessianProtocolException("'" + ref + "' is an unknown class definition"); ObjectDefinition def = _classDefs.get(ref); return readObjectInstance(cl, def); } case 'O': { int ref = readInt(); int size = _classDefs.size(); if (ref < 0 || size <= ref) throw new HessianProtocolException("'" + ref + "' is an unknown class definition"); ObjectDefinition def = _classDefs.get(ref); return readObjectInstance(cl, def); } case BC_LIST_VARIABLE: { String type = readType(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readList(this, -1); return v; } case BC_LIST_FIXED: { String type = readType(); int length = readInt(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readLengthList(this, length); return v; } case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: { int length = tag - 0x70; String type = readType(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readLengthList(this, length); return v; } case BC_LIST_VARIABLE_UNTYPED: { Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readList(this, -1); return v; } case BC_LIST_FIXED_UNTYPED: { int length = readInt(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readLengthList(this, length); return v; } case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: { int length = tag - 0x78; Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readLengthList(this, length); return v; } case BC_REF: { int ref = readInt(); return _refs.get(ref); } } if (tag >= 0) _offset--; Object value = findSerializerFactory().getDeserializer(cl).readObject(this); return value; } Hessian2Input();  Hessian2Input(InputStream is); void setSerializerFactory(SerializerFactory factory); SerializerFactory getSerializerFactory(); void allow(String pattern); void setCloseStreamOnClose(boolean isClose); boolean isCloseStreamOnClose(); String getMethod(); Throwable getReplyFault(); @Override void init(InputStream is); void initPacket(InputStream is); int readCall(); int readEnvelope(); void completeEnvelope(); String readMethod(); @Override int readMethodArgLength(); void startCall(); Object [] readArguments(); void completeCall(); @Override Object readReply(Class expectedClass); void startReply(); void completeReply(); void completeValueReply(); String readHeader(); int startMessage(); void completeMessage(); void readNull(); boolean readBoolean(); short readShort(); final int readInt(); long readLong(); float readFloat(); double readDouble(); long readUTCDate(); int readChar(); int readString(char []buffer, int offset, int length); String readString(); byte [] readBytes(); int readByte(); int readBytes(byte []buffer, int offset, int length); Object readObject(Class cl); Object readObject(); Object readRemote(); Object readRef(); int readListStart(); int readMapStart(); boolean isEnd(); void readEnd(); void readMapEnd(); void readListEnd(); @Override int addRef(Object ref); void setRef(int i, Object ref); @Override void resetReferences(); void reset(); void resetBuffer(); Object readStreamingObject(); Object resolveRemote(String type, String url); String readType(); int readLength(); InputStream readInputStream(); final int read(); Reader getReader(); void free(); @Override void close(); }
Hessian2Input extends AbstractHessianInput implements Hessian2Constants { public Object readObject(Class cl) throws IOException { if (cl == null || cl == Object.class) return readObject(); int tag = _offset < _length ? (_buffer[_offset++] & 0xff) : read(); switch (tag) { case 'N': return null; case 'H': { Deserializer reader = findSerializerFactory().getDeserializer(cl); return reader.readMap(this); } case 'M': { String type = readType(); if ("".equals(type)) { Deserializer reader; reader = findSerializerFactory().getDeserializer(cl); return reader.readMap(this); } else { Deserializer reader; reader = findSerializerFactory().getObjectDeserializer(type, cl); return reader.readMap(this); } } case 'C': { readObjectDefinition(cl); return readObject(cl); } case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: { int ref = tag - 0x60; int size = _classDefs.size(); if (ref < 0 || size <= ref) throw new HessianProtocolException("'" + ref + "' is an unknown class definition"); ObjectDefinition def = _classDefs.get(ref); return readObjectInstance(cl, def); } case 'O': { int ref = readInt(); int size = _classDefs.size(); if (ref < 0 || size <= ref) throw new HessianProtocolException("'" + ref + "' is an unknown class definition"); ObjectDefinition def = _classDefs.get(ref); return readObjectInstance(cl, def); } case BC_LIST_VARIABLE: { String type = readType(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readList(this, -1); return v; } case BC_LIST_FIXED: { String type = readType(); int length = readInt(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readLengthList(this, length); return v; } case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: { int length = tag - 0x70; String type = readType(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(type, cl); Object v = reader.readLengthList(this, length); return v; } case BC_LIST_VARIABLE_UNTYPED: { Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readList(this, -1); return v; } case BC_LIST_FIXED_UNTYPED: { int length = readInt(); Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readLengthList(this, length); return v; } case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: { int length = tag - 0x78; Deserializer reader; reader = findSerializerFactory().getListDeserializer(null, cl); Object v = reader.readLengthList(this, length); return v; } case BC_REF: { int ref = readInt(); return _refs.get(ref); } } if (tag >= 0) _offset--; Object value = findSerializerFactory().getDeserializer(cl).readObject(this); return value; } Hessian2Input();  Hessian2Input(InputStream is); void setSerializerFactory(SerializerFactory factory); SerializerFactory getSerializerFactory(); void allow(String pattern); void setCloseStreamOnClose(boolean isClose); boolean isCloseStreamOnClose(); String getMethod(); Throwable getReplyFault(); @Override void init(InputStream is); void initPacket(InputStream is); int readCall(); int readEnvelope(); void completeEnvelope(); String readMethod(); @Override int readMethodArgLength(); void startCall(); Object [] readArguments(); void completeCall(); @Override Object readReply(Class expectedClass); void startReply(); void completeReply(); void completeValueReply(); String readHeader(); int startMessage(); void completeMessage(); void readNull(); boolean readBoolean(); short readShort(); final int readInt(); long readLong(); float readFloat(); double readDouble(); long readUTCDate(); int readChar(); int readString(char []buffer, int offset, int length); String readString(); byte [] readBytes(); int readByte(); int readBytes(byte []buffer, int offset, int length); Object readObject(Class cl); Object readObject(); Object readRemote(); Object readRef(); int readListStart(); int readMapStart(); boolean isEnd(); void readEnd(); void readMapEnd(); void readListEnd(); @Override int addRef(Object ref); void setRef(int i, Object ref); @Override void resetReferences(); void reset(); void resetBuffer(); Object readStreamingObject(); Object resolveRemote(String type, String url); String readType(); int readLength(); InputStream readInputStream(); final int read(); Reader getReader(); void free(); @Override void close();  }