Data { public byte[] getByteArray() { return Helper.copyOfRange(data, pointer, data.length); } Data(byte[] data); int getUnsignedInt(); int getByte(); char getChar(); long getLongInteger(); String getString(); byte[] getBuffer(); String getPointer(); long getTime(); Hashtable getHashtable(); Hdata getHdata(); Info getInfo(); Infolist getInfolist(); Array getArray(); RelayObject getObject(); byte[] getByteArray(); boolean empty();  }
@Test public void testGetByteArray() { Data d = new Data(new byte[0]); assertEquals(0, d.getByteArray().length); d = new Data(new byte[]{5,1,2,3,4}); d.getUnsignedInt(); assertEquals(4,d.getByteArray()[0]); }