TamaUtils { public static byte[] unpackPayload(byte[] message) { int length = message[3] & 0xff; byte[] payload = new byte[length]; System.arraycopy(message, 5, payload, 0, payload.length); return payload; }  static void handleStatusCode(int status); static boolean isError(int status); static int getErrorCodeFromStatus(int status); static boolean isMoreInformation(int status); static boolean isNADPresent(int status); static byte[] unpackPayload(byte[] message);  }
@Test public void testUnpackPayload() throws Exception { byte[] payload = TamaUtils.unpackPayload(NfcUtils.convertASCIIToBin("0000FF02FED5131800")); assertArrayEquals(new byte[] { (byte)0xd5, 0x13 }, payload); }