public ZList(Pointer pointer) { int offset = 0; Buffer buffer = null; while (true) { buffer = pointer.buffer(offset + pointer.getSize()); Pointer p = new Pointer(buffer.subBuffer(offset, pointer.getSize())); if (Pointer.NULL.equals(p)) { break; } pointers.add(p); offset += p.getSize(); } assignBuffer(buffer); }
@Override public void set(T[] value) { if (pointers.length != value.length) { throw new IllegalArgumentException("Illegal length: " + value.length); } for (int i = 0; i < pointers.length; i++) { pointers[i].pointTo(copy(value[i])); } } }
public Optional<P6Signature3> getP6Signature() { Optional<P6Signature3> result = Optional.empty(); if (!Pointer.NULL.equals(p6Signature)) { result = Optional.of(new P6Signature3(p6Signature)); } return result; }
public <T extends Type> ZList(List<T> types) { for (int i = 0; i < types.size(); i++) { pointers.add(new Pointer()); } allocate(); int offset = 0; for (int i = 0; i < types.size(); i++) { Pointer p = pointers.get(i); p.assignBuffer(getBuffer().subBuffer(offset, p.getSize())); p.pointTo(types.get(i)); offset += p.getSize(); } }
public byte[] getCAPublicKeyCheckSum() { return cAPublicKeyCheckSum.buffer(20).get(); }
public PointerArray(final int length) { super(new Pointer[length]); for (int i = 0; i < length; i++) { array[i] = new Pointer(); } }
public WFSResult wfsGetInfo(final HSERVICE hService, final DWORD category, final Type queryDetails, final DWORD timeOut) throws XfsException { final String method = "wfsGetInfo(HSERVICE, DWORD, Type, DWORD)"; if (LOG.isDebugEnabled()) { LOG.debug(method, "hService=" + hService + ",category=" + category + ",queryDetails=" + queryDetails + ",timeOut=" + timeOut); } final Pointer pResult = new Pointer(); pResult.allocate(); final long errorCode = wfsGetInfo0(hService, category, queryDetails, timeOut, pResult); XfsException.throwFor(errorCode); final WFSResult wfsResult = new WFSResult(pResult); if (LOG.isDebugEnabled()) { LOG.debug(method, "wfsResult=" + wfsResult); } return wfsResult; }
/** * @param p * the {@link Pointer} of the first element * @param length * the length of the array, must be at least 1 * @throws IllegalArgumentException * if length <= 0 */ public PointerArray(final Pointer p, final int length) throws IllegalArgumentException { this(length); if (length <= 0) { throw new IllegalArgumentException("Invalid length: " + length + ", length must be at least 1"); } assignBuffer(p.buffer(p.getSize() * length)); } }
private Pointer(boolean allocate) { this(); if (allocate) { allocate(); } }
public Pointer(Pointer p) { this(); assignBuffer(p); }
public Optional<String> getMediaName() { Optional<String> result = Optional.empty(); if (!Pointer.NULL.equals(mediaName)) { result = Optional.of(mediaName.get()); } return result; }
public Optional<byte[]> getComparisonData() { Optional<byte[]> result = Optional.empty(); if (getLength() > 0) { result = Optional.of(comparisonData.buffer(getLength()).get()); } return result; }