@Override public void set(String[] value) { int length = 2; for (String each : value) { length += each.length() + 1; } byte[] dest = new byte[length]; int destPos = 0; for (String each : value) { byte[] src = each.getBytes(StandardCharsets.US_ASCII); System.arraycopy(src, 0, dest, destPos, src.length); destPos += src.length + 1; } pointTo(new ByteArray(dest)); }
@Override public String toString() { return Hex.encode(toByteArray()); } }
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; }
public byte[] toByteArray() { return getBytes(); }
/** * {@link #data} */ public void setData(final byte[] data) { setLength(data.length); ByteArray array = new ByteArray(data); this.data.pointTo(array); }
protected void set(byte[] copy) { length.set(copy.length); data.pointTo(new ByteArray(copy)); }
@Override public void set(Map<String, String> value) { if (value.isEmpty()) { pointTo(NULL); } else { pointTo(new ByteArray(encode(value))); } }
@Override public void set(Map<String, String> value) { if (value.isEmpty()) { pointTo(NULL); } else { pointTo(new ByteArray(encode(value))); } }
public HexData330(byte[] copy) { this(); allocate(); length.set(copy.length); data.pointTo(new ByteArray(copy)); }
protected void set(ChipPowerOut3 copy) { chipDataLength.set(copy.chipDataLength); chipData.pointTo(new ByteArray(copy.getChipData())); }
protected void set(Setkey3 copy) { keyLen.set(copy.keyLen); keyValue.pointTo(new ByteArray(copy.getKeyValue())); }
protected void set(HexData330 copy) { length.set(copy.length); data.pointTo(new ByteArray(copy.getData())); }
protected void set(RawDataIn3 copy) { size.set(copy.size); data.pointTo(new ByteArray(copy.getData())); }
protected void set(CardData3 copy) { dataSource.set(copy.getDataSource()); status.set(copy.getStatus()); dataLength.set(copy.dataLength); data.pointTo(new ByteArray(copy.getData())); Optional<WriteMethod> writeMethod = Optional.empty(); if (writeMethod.isPresent()) { this.writeMethod.set(writeMethod.get()); } }
public void set(byte[] value) { if (value == null) { data.pointTo(Pointer.NULL); dataLength.set(0); } else { dataLength.set(value.length); data.pointTo(new ByteArray(value)); } }
private RawData3(Builder builder) { this(); allocate(); inputData.set(builder.inputData); size.set(builder.data.length); data.pointTo(new ByteArray(builder.data)); }
protected void set(Image3 copy) { imageSource.set(copy.getImageSource()); status.set(copy.getStatus()); dataLength.set(copy.dataLength); Optional<byte[]> data = copy.getData(); if (data.isPresent()) { this.data.pointTo(new ByteArray(data.get())); } }
protected void set(ChipIo3 copy) { chipProtocol.set(copy.getChipProtocol()); chipDataLength.set(copy.chipDataLength); chipData.pointTo(new ByteArray(copy.getChipData())); }
protected void set(RawData3 copy) { inputData.set(copy.getInputData()); size.set(copy.size); data.pointTo(new ByteArray(copy.getData())); }