/** Read a native array of float of size <code>arraySize</code> from the given <code>offset</code> from this {@link Pointer}. */ public float[] getFloatArray(long offset, int arraySize) { float[] buf = new float[arraySize]; read(offset, buf, 0, arraySize); return buf; }
/** Returns an array of {@link Pointer} of the requested size. */ public Pointer[] getPointerArray(long offset, int arraySize) { Pointer[] buf = new Pointer[arraySize]; read(offset, buf, 0, arraySize); return buf; }
/** Read a native array of int32 of size <code>arraySize</code> from the given <code>offset</code> from this {@link Pointer}. */ public int[] getIntArray(long offset, int arraySize) { int[] buf = new int[arraySize]; read(offset, buf, 0, arraySize); return buf; }
/** Read a native array of bytes of size <code>arraySize</code> from the given <code>offset</code> from this {@link Pointer}. */ public byte[] getByteArray(long offset, int arraySize) { byte[] buf = new byte[arraySize]; read(offset, buf, 0, arraySize); return buf; }
/** Read a native array of wchar_t of size <code>arraySize</code> from the given <code>offset</code> from this {@link Pointer}. */ public char[] getCharArray(long offset, int arraySize) { char[] buf = new char[arraySize]; read(offset, buf, 0, arraySize); return buf; }
/** Read a native array of int64 of size <code>arraySize</code> from the given <code>offset</code> from this {@link Pointer}. */ public long[] getLongArray(long offset, int arraySize) { long[] buf = new long[arraySize]; read(offset, buf, 0, arraySize); return buf; }
/** Read a native array of double of size <code>arraySize</code> from the given <code>offset</code> from this {@link Pointer}. */ public double[] getDoubleArray(long offset, int arraySize) { double[] buf = new double[arraySize]; read(offset, buf, 0, arraySize); return buf; }
/** Read a native array of int16 of size <code>arraySize</code> from the given <code>offset</code> from this {@link Pointer}. */ public short[] getShortArray(long offset, int arraySize) { short[] buf = new short[arraySize]; read(offset, buf, 0, arraySize); return buf; }
/** * Indirect the native pointer to <code>malloc</code> space, a la * <code>Pointer.read</code>. But this method performs a bounds * checks to ensure that the indirection does not cause memory outside the * <code>malloc</code>ed space to be accessed. * * @see Pointer#read(long,byte[],int,int) */ @Override public void read(long bOff, byte[] buf, int index, int length) { boundsCheck(bOff, length * 1L); super.read(bOff, buf, index, length); }
/** * Indirect the native pointer to <code>malloc</code> space, a la * <code>Pointer.read</code>. But this method performs a bounds checks to * ensure that the indirection does not cause memory outside the * <code>malloc</code>ed space to be accessed. * * @see Pointer#read(long,double[],int,int) */ @Override public void read(long bOff, double[] buf, int index, int length) { boundsCheck(bOff, length * 8L); super.read(bOff, buf, index, length); }
/** * Indirect the native pointer to <code>malloc</code> space, a la * <code>Pointer.read</code>. But this method performs a bounds * checks to ensure that the indirection does not cause memory outside the * <code>malloc</code>ed space to be accessed. * * @see Pointer#read(long,float[],int,int) */ @Override public void read(long bOff, float[] buf, int index, int length) { boundsCheck(bOff, length * 4L); super.read(bOff, buf, index, length); }
/** * Indirect the native pointer to <code>malloc</code> space, a la * <code>Pointer.read</code>. But this method performs a bounds * checks to ensure that the indirection does not cause memory outside the * <code>malloc</code>ed space to be accessed. * * @see Pointer#read(long,short[],int,int) */ @Override public void read(long bOff, short[] buf, int index, int length) { boundsCheck(bOff, length * 2L); super.read(bOff, buf, index, length); }
/** * Indirect the native pointer to <code>malloc</code> space, a la * <code>Pointer.read</code>. But this method performs a bounds * checks to ensure that the indirection does not cause memory outside the * <code>malloc</code>ed space to be accessed. * * @see Pointer#read(long,char[],int,int) */ @Override public void read(long bOff, char[] buf, int index, int length) { boundsCheck(bOff, length * 2L); super.read(bOff, buf, index, length); }
/** * Indirect the native pointer to <code>malloc</code> space, a la * <code>Pointer.read</code>. But this method performs a bounds * checks to ensure that the indirection does not cause memory outside the * <code>malloc</code>ed space to be accessed. * * @see Pointer#read(long,int[],int,int) */ @Override public void read(long bOff, int[] buf, int index, int length) { boundsCheck(bOff, length * 4L); super.read(bOff, buf, index, length); }
/** * Indirect the native pointer to <code>malloc</code> space, a la * <code>Pointer.read</code>. But this method performs a bounds * checks to ensure that the indirection does not cause memory outside the * <code>malloc</code>ed space to be accessed. * * @see Pointer#read(long,long[],int,int) */ @Override public void read(long bOff, long[] buf, int index, int length) { boundsCheck(bOff, length * 8L); super.read(bOff, buf, index, length); }
read(offset, (byte[])result, 0, length); read(offset, (short[])result, 0, length); read(offset, (char[])result, 0, length); read(offset, (int[])result, 0, length); read(offset, (long[])result, 0, length); read(offset, (float[])result, 0, length); read(offset, (double[])result, 0, length); read(offset, (Pointer[])result, 0, length);
m.read(0, buf, 0, buf.length); this.memory.write(0, buf, 0, buf.length);
Structure s = Structure.newInstance((Class<? extends Structure>) dstType); byte[] buf = new byte[s.size()]; ((Pointer)value).read(0, buf, 0, buf.length); s.getPointer().write(0, buf, 0, buf.length); s.read();
public long[] getLongArray(long offset, int arraySize) { long[] buf = new long[arraySize]; read(offset, buf, 0, arraySize); return buf; }
public Pointer[] getPointerArray(long offset, int arraySize) { Pointer[] buf = new Pointer[arraySize]; read(offset, buf, 0, arraySize); return buf; }