@Test public void test() { byte[] fromObj = {113, 123, 124, 23}; byte[] result = Helper.byteArrayCut(fromObj, 0, 2); for (int i = 0; i < 2; i++) { System.out.println(result[i]); } byte[] result2 = Helper.byteArrayCut(fromObj, 2, 2); for (int i = 0; i < 2; i++) { System.out.println(result2[i]); } }
public byte[] getToAdress() { byte[] toAdress = Helper.byteArrayCut(data, FROM_ADDRESS_LENGTH, TO_ADDRESS_LENGTH); return toAdress; }
public InstructionTaskKind getTaskKind() { int pos = FROM_ADDRESS_LENGTH + TO_ADDRESS_LENGTH; byte[] kind = Helper.byteArrayCut(data, pos, TASK_KIND_LENGTH); return TaskMap.getTaskKind(kind); }
public byte[] getFromAddress() { byte[] fromAdress = Helper.byteArrayCut(data, 0, FROM_ADDRESS_LENGTH); return fromAdress; }