code: public <T> T readObject (Input input, Class<T> type) {
  		if (input == null) throw new IllegalArgumentException("input cannot be null.");
  		if (type == null) throw new IllegalArgumentException("type cannot be null.");
  		beginObject();
  		try {
  			T object;
  			if (references) {
  				int stackSize = readReferenceOrNull(input, type, false);
  				if (stackSize == REF) return (T)readObject;
  				object = (T)getRegistration(type).getSerializer().read(this, input, type);
  				if (stackSize == readReferenceIds.size) reference(object);
  			} else
  				object = (T)getRegistration(type).getSerializer().read(this, input, type);
  			if (TRACE || (DEBUG && depth == 1)) log("Read", object, input.position());
  			return object;
  		} finally {
  			if (--depth == 0 && autoReset) reset();
  		}
  	}
docs: Reads an object using the registered serializer.