buf.get(0, dest, 0, sz); oe.getOut().write(dest); oe.setWriteOffset(offset + size);
@Override protected final byte[] out(final byte[] buffer, final Pointer ptr, final long ptrAddr) { final long addr = ptr.getLong(STRUCT_FIELD_OFFSET_DATA); final int size = (int) ptr.getLong(STRUCT_FIELD_OFFSET_SIZE); final Pointer pointer = MEM_MGR.newPointer(addr, size); final byte[] bytes = new byte[size]; pointer.get(0, bytes, 0, size); return bytes; } }
@Override protected final byte[] out(final byte[] buffer, final Pointer ptr, final long ptrAddr) { final long addr = ptr.getAddress(STRUCT_FIELD_OFFSET_DATA); final int size = (int) ptr.getLong(STRUCT_FIELD_OFFSET_SIZE); final Pointer pointer = MEM_MGR.newPointer(addr, size); final byte[] bytes = new byte[size]; pointer.get(0, bytes, 0, size); return bytes; } }
@Override public void get(long offset, float[] dst, int off, int len) { checkBounds(size, offset, len * Float.SIZE / 8); io.get(base + offset, dst, off, len); }
@Override public void get(long offset, byte[] dst, int off, int len) { checkBounds(size, offset, len); io.get(base + offset, dst, off, len); }
@Override public void get(long offset, short[] dst, int off, int len) { checkBounds(size, offset, len * Short.SIZE / 8); io.get(base + offset, dst, off, len); }
@Override public void get(long offset, long[] dst, int off, int len) { checkBounds(size, offset, len * Long.SIZE / 8); io.get(base + offset, dst, off, len); }
@Override public void get(long offset, long[] dst, int off, int len) { checkBounds(size, offset, len * Long.SIZE / 8); io.get(base + offset, dst, off, len); }
@Override public void get(long offset, double[] dst, int off, int len) { checkBounds(size, offset, len * Double.SIZE / 8); io.get(base + offset, dst, off, len); }
@Override public void get(long offset, byte[] dst, int off, int len) { checkBounds(size, offset, len); io.get(base + offset, dst, off, len); }
@Override public void get(long offset, int[] dst, int off, int len) { checkBounds(size, offset, len * Integer.SIZE / 8); io.get(base + offset, dst, off, len); }
@Override public void get(long offset, short[] dst, int off, int len) { checkBounds(size, offset, len * Short.SIZE / 8); io.get(base + offset, dst, off, len); }
@Override public void get(long offset, int[] dst, int off, int len) { checkBounds(size, offset, len * Integer.SIZE / 8); io.get(base + offset, dst, off, len); }
public ByteBuffer get() { int len = getLen(); byte[] bytes = new byte[len]; layout.iov_base.get( this.memory ).get(0, bytes, 0, len ); return ByteBuffer.wrap( bytes ); }
public ByteBuffer get() { int len = getLen(); byte[] bytes = new byte[len]; layout.iov_base.get( this.memory ).get(0, bytes, 0, len ); return ByteBuffer.wrap( bytes ); }
public ByteBuffer get() { int len = getLen(); byte[] bytes = new byte[len]; layout.iov_base.get( this.memory ).get(0, bytes, 0, len ); return ByteBuffer.wrap( bytes ); }
public ByteBuffer getData() { int dataLen = getLen() - posix.socketMacros().CMSG_LEN(0); if ( dataLen == 0 ) { return null; } byte[] bytes = new byte[dataLen]; posix.socketMacros().CMSG_DATA(this.memory).get(0, bytes, 0, bytes.length); ByteBuffer buf = ByteBuffer.allocate(bytes.length); buf.put(bytes); buf.flip(); return buf; }
public ByteBuffer getData() { int dataLen = getLen() - posix.socketMacros().CMSG_LEN(0); if ( dataLen == 0 ) { return null; } byte[] bytes = new byte[dataLen]; posix.socketMacros().CMSG_DATA(this.memory).get(0, bytes, 0, bytes.length); ByteBuffer buf = ByteBuffer.allocate(bytes.length); buf.put(bytes); buf.flip(); return buf; }
public byte[] crypt(byte[] key, byte[] salt) { Pointer ptr = libc().crypt(key, salt); if (ptr == null) return null; int end = ptr.indexOf(0, (byte)0); byte[] bytes = new byte[end + 1]; ptr.get(0, bytes, 0, end); return bytes; }
public byte[] crypt(byte[] key, byte[] salt) { Crypt crypt = crypt(); if (crypt == null) { return JavaLibCHelper.crypt(key, salt); } Pointer ptr = crypt().crypt(key, salt); if (ptr == null) return null; int end = ptr.indexOf(0, (byte)0); byte[] bytes = new byte[end + 1]; ptr.get(0, bytes, 0, end); return bytes; }