public byte[] data(int ctn, int dad, int sad, byte[] command) throws CTException { final String method = "data(int, int, int, byte[])"; if (LOG.isDebugEnabled()) { LOG.debug(method, "ctn=" + ctn + ",dad=" + dad + ",sad=" + sad + ",command=" + Hex.encode(command)); } ByteArray cmdBuf = new ByteArray(command); ByteArray rspBuf = new ByteArray(258); USHORT lenr = new USHORT(rspBuf.getSize()); int rc = data0(dataFunctionAddress, new USHORT(ctn), new UINT8(dad), new UINT8(sad), cmdBuf, lenr, rspBuf); CTException.throwFor(rc); byte[] rsp = new byte[lenr.intValue()]; System.arraycopy(rspBuf.toByteArray(), 0, rsp, 0, rsp.length); if (LOG.isDebugEnabled()) { LOG.debug(method, "rsp=" + Hex.encode(rsp)); } return rsp; }