use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testDoubleArray.
@Test
public void testDoubleArray() throws IOException {
double[] arr = new double[] { Double.MIN_VALUE, -1, Math.PI, Double.MAX_VALUE };
out.writeDoubleArray(arr);
ObjectDataInput in = getDataInputFromOutput();
assertArrayEquals(arr, in.readDoubleArray(), 1e-10D);
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testFloatArray.
@Test
public void testFloatArray() throws IOException {
float[] arr = new float[] { Float.MIN_VALUE, -1, Float.MAX_VALUE };
out.writeFloatArray(arr);
ObjectDataInput in = getDataInputFromOutput();
assertArrayEquals(arr, in.readFloatArray(), 1e-10F);
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testCharArray.
@Test
public void testCharArray() throws IOException {
char[] arr = new char[] { Character.MIN_VALUE, Character.MAX_VALUE };
out.writeCharArray(arr);
ObjectDataInput in = getDataInputFromOutput();
assertArrayEquals(arr, in.readCharArray());
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testUTF.
@Test
public void testUTF() throws IOException {
String s1 = "Vim is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain text.";
String s2 = "簡単なものから複雑なものまで、具体的な例を使って説明しています。本のように最初から順を追って読んでください。";
out.writeString(s1);
out.writeString(s2);
ObjectDataInput in = getDataInputFromOutput();
assertEquals(s1, in.readString());
assertEquals(s2, in.readString());
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class SerializationV1Portable method readPortable.
@Override
public void readPortable(PortableReader in) throws IOException {
this.aByte = in.readByte("1");
this.aBoolean = in.readBoolean("2");
this.character = in.readChar("3");
this.aShort = in.readShort("4");
this.integer = in.readInt("5");
this.aLong = in.readLong("6");
this.aFloat = in.readFloat("7");
this.aDouble = in.readDouble("8");
this.string = in.readString("9");
this.bytes = in.readByteArray("a1");
this.booleans = in.readBooleanArray("a2");
this.chars = in.readCharArray("a3");
this.shorts = in.readShortArray("a4");
this.ints = in.readIntArray("a5");
this.longs = in.readLongArray("a6");
this.floats = in.readFloatArray("a7");
this.doubles = in.readDoubleArray("a8");
this.strings = in.readStringArray("a9");
this.innerPortable = in.readPortable("p");
ObjectDataInput rawDataInput = in.getRawDataInput();
boolean isNotNull = rawDataInput.readBoolean();
if (isNotNull) {
SerializationV1DataSerializable dataserializable = new SerializationV1DataSerializable();
dataserializable.readData(rawDataInput);
this.dataSerializable = dataserializable;
}
}
Aggregations