use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class PortableEntryEvent method readPortable.
@Override
public void readPortable(PortableReader reader) throws IOException {
eventType = EntryEventType.getByType(reader.readInt("e"));
uuid = reader.readUTF("u");
numberOfAffectedEntries = reader.readInt("n");
ObjectDataInput in = reader.getRawDataInput();
key = in.readData();
value = in.readData();
oldValue = in.readData();
mergingValue = in.readData();
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class PortablePartitionLostEvent method readPortable.
@Override
public void readPortable(PortableReader reader) throws IOException {
partitionId = reader.readInt("p");
lostBackupCount = reader.readInt("l");
final ObjectDataInput in = reader.getRawDataInput();
source = in.readObject();
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class RawDataPortable method readPortable.
@Override
public void readPortable(PortableReader reader) throws IOException {
l = reader.readLong("l");
c = reader.readCharArray("c");
p = reader.readPortable("p");
final ObjectDataInput input = reader.getRawDataInput();
k = input.readInt();
s = input.readUTF();
sds = input.readObject();
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class DataInputOutputTest method testDataStreams.
private void testDataStreams(Object object, ByteOrder byteOrder, boolean allowUnsafe) throws IOException {
InternalSerializationService ss = createSerializationServiceBuilder().setUseNativeByteOrder(false).setAllowUnsafe(allowUnsafe).setByteOrder(byteOrder).build();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
ObjectDataOutput out = createObjectDataOutputStream(bout, ss);
out.writeObject(object);
byte[] data1 = bout.toByteArray();
ObjectDataOutput out2 = ss.createObjectDataOutput(1024);
out2.writeObject(object);
byte[] data2 = out2.toByteArray();
assertEquals(data1.length, data2.length);
assertTrue(Arrays.equals(data1, data2));
final ByteArrayInputStream bin = new ByteArrayInputStream(data2);
final ObjectDataInput in = createObjectDataInputStream(bin, ss);
final Object object1 = in.readObject();
final ObjectDataInput in2 = ss.createObjectDataInput(data1);
final Object object2 = in2.readObject();
Assert.assertEquals(object, object1);
Assert.assertEquals(object, object2);
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class InvalidRawDataPortable2 method readPortable.
@Override
public void readPortable(PortableReader reader) throws IOException {
c = reader.readCharArray("c");
final ObjectDataInput input = reader.getRawDataInput();
k = input.readInt();
l = reader.readLong("l");
s = input.readUTF();
p = reader.readPortable("p");
sds = input.readObject();
}
Aggregations