use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testShort.
@Test
public void testShort() throws IOException {
// negative shorts
out.writeShort(Short.MIN_VALUE);
out.writeShort(-250);
// positive shorts
out.writeShort(132);
out.writeShort(Short.MAX_VALUE);
ObjectDataInput input = getDataInputFromOutput();
assertEquals(Short.MIN_VALUE, input.readShort());
assertEquals(-250, input.readShort());
assertEquals(132, input.readShort());
assertEquals(Short.MAX_VALUE, input.readShort());
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testFloat.
@Test
public void testFloat() throws IOException {
out.writeFloat(Float.MIN_VALUE);
out.writeFloat(-1);
out.writeFloat(Float.MAX_VALUE);
ObjectDataInput in = getDataInputFromOutput();
assertEquals(Float.MIN_VALUE, in.readFloat(), 1e-10F);
assertEquals(-1, in.readFloat(), 1e-10F);
assertEquals(Float.MAX_VALUE, in.readFloat(), 1e-10F);
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testShortArray.
@Test
public void testShortArray() throws IOException {
short[] arr = new short[] { Short.MIN_VALUE, -250, 132, Short.MAX_VALUE };
out.writeShortArray(arr);
ObjectDataInput in = getDataInputFromOutput();
assertArrayEquals(arr, in.readShortArray());
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testBooleanArray.
@Test
public void testBooleanArray() throws IOException {
boolean[] arr = new boolean[] { true, false };
out.writeBooleanArray(arr);
ObjectDataInput in = getDataInputFromOutput();
assertArrayEquals(arr, in.readBooleanArray());
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AbstractDataStreamIntegrationTest method testUnsignedShort.
@Test
public void testUnsignedShort() throws IOException {
// unsigned short, out of range of signed short
out.writeShort(Short.MAX_VALUE + 200);
out.writeShort(Short.MAX_VALUE + 1);
out.writeShort(0xFFFF);
ObjectDataInput input = getDataInputFromOutput();
assertEquals(Short.MAX_VALUE + 200, input.readUnsignedShort());
assertEquals(Short.MAX_VALUE + 1, input.readUnsignedShort());
assertEquals(0xFFFF, input.readUnsignedShort());
}
Aggregations