@Override public void encode(final DataOutputExtended output) throws IOException { output.writeUTF(type); output.writeEncodable(oid); output.writeEncodable(version); output.writeBoolean(isResolved); output.writeEncodables(fieldContent); }
@Override public void encode(final DataOutputExtended output) throws IOException { output.writeInt(id); output.writeEncodable(object); }
@Override public void encode(final DataOutputExtended output) throws IOException { output.writeUTF(type); output.writeEncodable(oid); output.writeEncodable(version); }
@Override public void encode(final DataOutputExtended output) throws IOException { output.writeUTF(className); output.writeSerializable(primaryKey); output.writeSerializable(newPrimaryKey); output.writeEncodable(previous); output.writeSerializable(state); }
@Override public <T> T readObject(final DataInputExtended input, final Class<T> cls) throws IOException { // not quite symmetrical with write; the byte has already been // read from stream // to determine which As instance to delegate to return input.readEncodable(cls); } },
@Override public <T> T readObject(final DataInputExtended input, final Class<T> cls) throws IOException { // not quite symmetrical with write; the byte has already been // read from stream // to determine which As instance to delegate to return input.readSerializable(cls); } };
@Test public void encodeAndDecodeByteArray() throws IOException { final byte[] bytes = { 3, 76, -1, 21 }; outputImpl.writeBytes(bytes); final byte[] decodedBytes = inputImpl.readBytes(); assertThatArraysEqual(bytes, decodedBytes); }
@Override public int[] readInts() throws IOException { return underlying.readInts(); }
@Override @SuppressWarnings("unchecked") public <T> T readSerializable(final Class<T> serializableType) throws IOException { return (T) FieldType.SERIALIZABLE.read(this); }
@Override public char readChar() throws IOException { return underlying.readChar(); }
@Override public char[] readChars() throws IOException { return underlying.readChars(); }
@Override public int readUnsignedShort() throws IOException { return underlying.readUnsignedShort(); }
@Override public float readFloat() throws IOException { return underlying.readFloat(); }
@Override public <T> T[] readSerializables(final Class<T> serializableType) throws IOException { return underlying.readSerializables(serializableType); }
@Override public int skipBytes(final int n) throws IOException { return underlying.skipBytes(n); }
@Override public void encode(final DataOutputExtended output) throws IOException { output.writeUTF(collectionType); output.writeUTF(elementType); output.writeEncodable(oid); output.writeEncodable(version); output.writeBoolean(hasAllElements); output.writeEncodables(elements); }
@Override public void encode(final DataOutputExtended output) throws IOException { output.writeUTF(className); output.writeEncodable(oid); }
@Override public void encode(final DataOutputExtended output) throws IOException { output.writeInt(id); output.writeEncodable(session); }
@Override public String readUTF() throws IOException { return FieldType.STRING.read(this); }