use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testUnsignedByte.
@Test
public void testUnsignedByte() throws IOException {
out.write(0xff);
out.write(-1);
out.write(Byte.MAX_VALUE + 1);
ObjectDataInput in = getDataInputFromOutput();
assertEquals(0xff, in.readUnsignedByte());
assertEquals(0xff, in.readUnsignedByte());
assertEquals(Byte.MAX_VALUE + 1, in.readUnsignedByte());
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testLongArray.
@Test
public void testLongArray() throws IOException {
long[] arr = new long[] { Long.MIN_VALUE, -1, Long.MAX_VALUE };
out.writeLongArray(arr);
ObjectDataInput in = getDataInputFromOutput();
assertArrayEquals(arr, in.readLongArray());
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testUTFArray.
@Test
public void testUTFArray() 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 = "簡単なものから複雑なものまで、具体的な例を使って説明しています。本のように最初から順を追って読んでください。";
String[] arr = new String[] { s1, s2 };
out.writeUTFArray(arr);
ObjectDataInput in = getDataInputFromOutput();
assertArrayEquals(arr, in.readStringArray());
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testChar.
@Test
public void testChar() throws IOException {
out.writeChar(Character.MIN_VALUE);
out.writeChar(Character.MAX_VALUE);
ObjectDataInput in = getDataInputFromOutput();
assertEquals(Character.MIN_VALUE, in.readChar());
assertEquals(Character.MAX_VALUE, in.readChar());
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testIntArray.
@Test
public void testIntArray() throws IOException {
int[] arr = new int[] { Integer.MIN_VALUE, -250, 132, Integer.MAX_VALUE };
out.writeIntArray(arr);
ObjectDataInput in = getDataInputFromOutput();
assertArrayEquals(arr, in.readIntArray());
}
Aggregations