}
@Test
public void testGetInvalidArgs()
{
IBuffer buf = IBuffer.make(null, 1);
byte[] in = new byte[]{ 0x38, 0x2C };
byte[] out = new byte[]{ 0x53, 0x7C};
try {
buf.put(in, 0, 0, 2);
fail("should fail on 2 bytes");
} catch (IndexOutOfBoundsException e) {}
try {
buf.get(0, out, 0, 2);
fail("should fail on 2 bytes");
} catch (IndexOutOfBoundsException e) {}
try {
buf.put(in, -1, 0, 1);
fail("should fail on 2 bytes");
} catch (IndexOutOfBoundsException e) {}
try {
buf.get(-1, out, 0, 1);
fail("should fail on 2 bytes");
} catch (IndexOutOfBoundsException e) {}
try {
buf.put(in, 0, -1, 1);
fail("should fail on 2 bytes");
} catch (IndexOutOfBoundsException e) {}
try {
buf.get(0, out, -1, 1);
fail("should fail on 2 bytes");
} catch (IndexOutOfBoundsException e) {}
try {
buf.put(in, 0, 1, 1);
fail("should fail on 2 bytes");
} catch (IndexOutOfBoundsException e) {}
try {
buf.get(0, out, 3, 1);
fail("should fail on 2 bytes");
} catch (IndexOutOfBoundsException e) {}
try {
buf.put(in, 3, 0, 1);
fail("should fail on 2 bytes");
} catch (IndexOutOfBoundsException e) {}
try {
buf.get(1, out, 0, 1);
fail("should fail on 2 bytes");
} catch (IndexOutOfBoundsException e) {}
buf.put(in, 0, 0, 1);
buf.get(0, out, 0, 1);
assertEquals(in[0], out[0]);
assertNotSame(in[1], out[1]);
buf.delete();
}