}
public void testBytesWithoutOffset() {
final Random rnd = new Random();
ODirectMemory directMemory = new OJNADirectMemory();
byte[] value = new byte[256];
rnd.nextBytes(value);
long pointer = directMemory.allocate(value.length);
directMemory.set(pointer, value, 0, value.length);
Assert.assertEquals(directMemory.get(pointer, value.length), value);
Assert.assertEquals(directMemory.get(pointer, value.length / 2), Arrays.copyOf(value, value.length / 2));
byte[] result = new byte[value.length];
directMemory.get(pointer, result, value.length / 2, value.length / 2);
byte[] expectedResult = new byte[value.length];
System.arraycopy(value, 0, expectedResult, expectedResult.length / 2, expectedResult.length / 2);
Assert.assertEquals(result, expectedResult);
directMemory.free(pointer);
}