public final ByteBuffer get (byte[] dest, int off, int len) { int length = dest.length; if (off < 0 || len < 0 || (long)off + (long)len > length) { throw new IndexOutOfBoundsException(); } if (len > remaining()) { throw new BufferUnderflowException(); } for (int i = 0; i < len; i++) { dest[i + off] = get(position + i); } position += len; return this; }
public final ByteBuffer get (byte[] dest, int off, int len) { int length = dest.length; if (off < 0 || len < 0 || (long)off + (long)len > length) { throw new IndexOutOfBoundsException(); } if (len > remaining()) { throw new BufferUnderflowException(); } for (int i = 0; i < len; i++) { dest[i + off] = get(position + i); } position += len; return this; }
@Override public DoubleBuffer get(double[] dst, int dstOffset, int doubleCount) { byteBuffer.limit(limit * SizeOf.DOUBLE); byteBuffer.position(position * SizeOf.DOUBLE); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, doubleCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, doubleCount); } this.position += doubleCount; return this; }
@Override public IntBuffer get(int[] dst, int dstOffset, int intCount) { byteBuffer.limit(limit * SizeOf.INT); byteBuffer.position(position * SizeOf.INT); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, intCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, intCount); } this.position += intCount; return this; }
@Override public ShortBuffer get(short[] dst, int dstOffset, int shortCount) { byteBuffer.limit(limit * SizeOf.SHORT); byteBuffer.position(position * SizeOf.SHORT); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, shortCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, shortCount); } this.position += shortCount; return this; }
@Override public LongBuffer get(long[] dst, int dstOffset, int longCount) { byteBuffer.limit(limit * SizeOf.LONG); byteBuffer.position(position * SizeOf.LONG); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, longCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, longCount); } this.position += longCount; return this; }
@Override public FloatBuffer get(float[] dst, int dstOffset, int floatCount) { byteBuffer.limit(limit * SizeOf.FLOAT); byteBuffer.position(position * SizeOf.FLOAT); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, floatCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, floatCount); } this.position += floatCount; return this; }
@Override public CharBuffer get(char[] dst, int dstOffset, int charCount) { byteBuffer.limit(limit * SizeOf.CHAR); byteBuffer.position(position * SizeOf.CHAR); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, charCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, charCount); } this.position += charCount; return this; }
@Override public FloatBuffer get(float[] dst, int dstOffset, int floatCount) { byteBuffer.limit(limit * SizeOf.FLOAT); byteBuffer.position(position * SizeOf.FLOAT); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, floatCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, floatCount); } this.position += floatCount; return this; }
@Override public ShortBuffer get(short[] dst, int dstOffset, int shortCount) { byteBuffer.limit(limit * SizeOf.SHORT); byteBuffer.position(position * SizeOf.SHORT); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, shortCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, shortCount); } this.position += shortCount; return this; }
@Override public IntBuffer get(int[] dst, int dstOffset, int intCount) { byteBuffer.limit(limit * SizeOf.INT); byteBuffer.position(position * SizeOf.INT); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, intCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, intCount); } this.position += intCount; return this; }
@Override public FloatBuffer get(float[] dst, int dstOffset, int floatCount) { byteBuffer.limit(limit * SizeOf.FLOAT); byteBuffer.position(position * SizeOf.FLOAT); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, floatCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, floatCount); } this.position += floatCount; return this; }
@Override public DoubleBuffer get(double[] dst, int dstOffset, int doubleCount) { byteBuffer.limit(limit * SizeOf.DOUBLE); byteBuffer.position(position * SizeOf.DOUBLE); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, doubleCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, doubleCount); } this.position += doubleCount; return this; }
@Override public CharBuffer get(char[] dst, int dstOffset, int charCount) { byteBuffer.limit(limit * SizeOf.CHAR); byteBuffer.position(position * SizeOf.CHAR); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, charCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, charCount); } this.position += charCount; return this; }
@Override public DoubleBuffer get(double[] dst, int dstOffset, int doubleCount) { byteBuffer.limit(limit * SizeOf.DOUBLE); byteBuffer.position(position * SizeOf.DOUBLE); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, doubleCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, doubleCount); } this.position += doubleCount; return this; }
@Override public LongBuffer get(long[] dst, int dstOffset, int longCount) { byteBuffer.limit(limit * SizeOf.LONG); byteBuffer.position(position * SizeOf.LONG); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, longCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, longCount); } this.position += longCount; return this; }
@Override public DoubleBuffer get(double[] dst, int dstOffset, int doubleCount) { byteBuffer.limit(limit * SizeOf.DOUBLE); byteBuffer.position(position * SizeOf.DOUBLE); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, doubleCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, doubleCount); } this.position += doubleCount; return this; }
@Override public CharBuffer get(char[] dst, int dstOffset, int charCount) { byteBuffer.limit(limit * SizeOf.CHAR); byteBuffer.position(position * SizeOf.CHAR); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, charCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, charCount); } this.position += charCount; return this; }
@Override public LongBuffer get(long[] dst, int dstOffset, int longCount) { byteBuffer.limit(limit * SizeOf.LONG); byteBuffer.position(position * SizeOf.LONG); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, longCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, longCount); } this.position += longCount; return this; }
@Override public IntBuffer get(int[] dst, int dstOffset, int intCount) { byteBuffer.limit(limit * SizeOf.INT); byteBuffer.position(position * SizeOf.INT); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, intCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, intCount); } this.position += intCount; return this; }