public int readUnsignedByte() throws IOException { while (remaining == 0) { readBlockHeader(riverUnmarshaller.readUnsignedByte()); } if (remaining == -1) { throw new EOFException(); } remaining--; return riverUnmarshaller.readUnsignedByte(); }
public void start(final ByteInput byteInput) throws IOException { super.start(byteInput); int version = readUnsignedByte(); if (version < MIN_VERSION || version > configuredVersion || version > MAX_VERSION) { throw new IOException("Unsupported protocol version " + version); } this.version = version; }
Object doReadObject(final boolean unshared, final boolean discardMissing) throws IOException, ClassNotFoundException { return doReadObject(readUnsignedByte(), unshared, discardMissing); }
public boolean readBoolean() throws IOException { while (remaining == 0) { readBlockHeader(riverUnmarshaller.readUnsignedByte()); } if (remaining == -1) { throw new EOFException(); } remaining--; return riverUnmarshaller.readBoolean(); }
public byte readByte() throws IOException { while (remaining == 0) { readBlockHeader(riverUnmarshaller.readUnsignedByte()); } if (remaining == -1) { throw new EOFException(); } remaining--; return riverUnmarshaller.readByte(); }
protected Object doReadObject(final boolean unshared) throws ClassNotFoundException, IOException { final Object obj = doReadObject(readUnsignedByte(), unshared, false); if (depth == 0) { final SortedSet<Validator> validators = this.validators; if (validators != null) { this.validators = null; validatorSeq = 0; for (Validator validator : validators) { validator.getValidation().validateObject(); } } } return obj; }
void readBlockHeader(int leadByte) throws IOException { switch (leadByte) { case Protocol.ID_START_BLOCK_SMALL: remaining = riverUnmarshaller.readUnsignedByte(); return; case Protocol.ID_START_BLOCK_MEDIUM: remaining = riverUnmarshaller.readUnsignedShort(); return; case Protocol.ID_START_BLOCK_LARGE: final int len = riverUnmarshaller.readInt(); if (len < 0) { throw new StreamCorruptedException("Invalid block length"); } remaining = len; return; case Protocol.ID_END_BLOCK_DATA: remaining = -1; return; default: throw badLeadByte(leadByte); } }
return replace(doReadNewObject(readUnsignedByte(), unshared, discardMissing)); int length = readUnsignedByte(); final String s = UTFUtils.readUTFBytes(this, length == 0 ? 0x100 : length); instanceCache.add(s); final Object obj = Array.newInstance(doReadClassDescriptor(readUnsignedByte(), true).getType(), 0); instanceCache.add(obj); final Object resolvedObject = objectResolver.readResolve(obj); final int len = readUnsignedByte(); return replace(doReadArray(len == 0 ? 0x100 : len, unshared, discardMissing)); int b = readUnsignedByte(); len = b == 0 ? 0x100 : b; break; final int id = readUnsignedByte(); switch (id) { case ID_CC_ARRAY_LIST: { final ClassDescriptor nestedDescriptor = doReadClassDescriptor(readUnsignedByte(), true); final Class<? extends Enum> elementType = nestedDescriptor.getType().asSubclass(Enum.class); return replace(readCollectionData(unshared, -1, len, EnumSet.noneOf(elementType), discardMissing)); int idx = instanceCache.size(); instanceCache.add(UNRESOLVED); final ClassDescriptor nestedDescriptor = doReadClassDescriptor(readUnsignedByte(), true); final Class<? extends Enum> elementType = nestedDescriptor.getType().asSubclass(Enum.class);
final SerializableClass serializableClass = registry.lookup(type); int descType = serializableClass.hasWriteObject() ? ID_WRITE_OBJECT_CLASS : ID_SERIALIZABLE_CLASS; final ClassDescriptor descriptor = new BasicSerializableClassDescriptor(serializableClass, doReadClassDescriptor(readUnsignedByte(), true), serializableClass.getFields(), descType); classCache.set(idx, descriptor); return descriptor; for (int i = 0; i < cnt; i ++) { names[i] = configuredVersion >= 4 ? readObject(String.class) : readUTF(); descriptors[i] = doReadClassDescriptor(readUnsignedByte(), true); unshareds[i] = readBoolean(); ClassDescriptor superDescriptor = doReadClassDescriptor(readUnsignedByte(), false); final Class<?> superClazz = clazz == null ? superDescriptor.getNearestType() : clazz.getSuperclass(); if (superDescriptor != null && (clazz == null || localSerializable)) { final ClassDescriptor elementType = doReadClassDescriptor(readUnsignedByte(), true); final SimpleClassDescriptor arrayDescriptor = new SimpleClassDescriptor(Array.newInstance(elementType.getType(), 0).getClass(), ID_OBJECT_ARRAY_TYPE_CLASS); classCache.add(arrayDescriptor);
final ClassDescriptor nestedDescriptor = doReadClassDescriptor(readUnsignedByte(), true);
private Object doReadArray(final int cnt, final boolean unshared, final boolean discardMissing) throws ClassNotFoundException, IOException { final int leadByte = readUnsignedByte(); switch (leadByte) { case ID_PRIM_BOOLEAN: {
public int readUnsignedByte() throws IOException { while (remaining == 0) { readBlockHeader(riverUnmarshaller.readUnsignedByte()); } if (remaining == -1) { throw new EOFException(); } remaining--; return riverUnmarshaller.readUnsignedByte(); }
public int readUnsignedByte() throws IOException { while (remaining == 0) { readBlockHeader(riverUnmarshaller.readUnsignedByte()); } if (remaining == -1) { throw new EOFException(); } remaining--; return riverUnmarshaller.readUnsignedByte(); }
public void start(final ByteInput byteInput) throws IOException { super.start(byteInput); int version = readUnsignedByte(); if (version < MIN_VERSION || version > configuredVersion || version > MAX_VERSION) { throw new IOException("Unsupported protocol version " + version); } this.version = version; }
public void start(final ByteInput byteInput) throws IOException { super.start(byteInput); int version = readUnsignedByte(); if (version < MIN_VERSION || version > configuredVersion || version > MAX_VERSION) { throw new IOException("Unsupported protocol version " + version); } this.version = version; }
public boolean readBoolean() throws IOException { while (remaining == 0) { readBlockHeader(riverUnmarshaller.readUnsignedByte()); } if (remaining == -1) { throw new EOFException(); } remaining--; return riverUnmarshaller.readBoolean(); }
public byte readByte() throws IOException { while (remaining == 0) { readBlockHeader(riverUnmarshaller.readUnsignedByte()); } if (remaining == -1) { throw new EOFException(); } remaining--; return riverUnmarshaller.readByte(); }
public boolean readBoolean() throws IOException { while (remaining == 0) { readBlockHeader(riverUnmarshaller.readUnsignedByte()); } if (remaining == -1) { throw new EOFException(); } remaining--; return riverUnmarshaller.readBoolean(); }
public byte readByte() throws IOException { while (remaining == 0) { readBlockHeader(riverUnmarshaller.readUnsignedByte()); } if (remaining == -1) { throw new EOFException(); } remaining--; return riverUnmarshaller.readByte(); }
public byte readByte() throws IOException { while (remaining == 0) { readBlockHeader(riverUnmarshaller.readUnsignedByte()); } if (remaining == -1) { throw new EOFException(); } remaining--; return riverUnmarshaller.readByte(); }