static ReadWriteHeapByteBuffer copy (HeapByteBuffer other, int markOfOther) { ReadWriteHeapByteBuffer buf = new ReadWriteHeapByteBuffer(other.backingArray, other.capacity(), other.offset); buf.limit = other.limit(); buf.position = other.position(); buf.mark = markOfOther; buf.order(other.order()); return buf; }
public final float getFloat () { return Numbers.intBitsToFloat(getInt()); }
public final double getDouble (int index) { return Numbers.longBitsToDouble(getLong(index)); }
public final long getLong (int index) { if (index < 0 || index + 8 > limit) { throw new IndexOutOfBoundsException(); } return loadLong(index); }
public final int getInt (int index) { if (index < 0 || index + 4 > limit) { throw new IndexOutOfBoundsException(); } return loadInt(index); }
public final short getShort (int index) { if (index < 0 || index + 2 > limit) { throw new IndexOutOfBoundsException(); } return loadShort(index); }
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(); } System.arraycopy(backingArray, offset + position, dest, off, len); position += len; return this; }
public final long getLong (int index) { if (index < 0 || index + 8 > limit) { throw new IndexOutOfBoundsException(); } return loadLong(index); }
public final int getInt (int index) { if (index < 0 || index + 4 > limit) { throw new IndexOutOfBoundsException(); } return loadInt(index); }
public final short getShort (int index) { if (index < 0 || index + 2 > limit) { throw new IndexOutOfBoundsException(); } return loadShort(index); }
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(); } System.arraycopy(backingArray, offset + position, dest, off, len); position += len; return this; }
static ReadWriteHeapByteBuffer copy (HeapByteBuffer other, int markOfOther) { ReadWriteHeapByteBuffer buf = new ReadWriteHeapByteBuffer(other.backingArray, other.capacity(), other.offset); buf.limit = other.limit(); buf.position = other.position(); buf.mark = markOfOther; buf.order(other.order()); return buf; }
public final long getLong () { int newPosition = position + 8; if (newPosition > limit) { throw new BufferUnderflowException(); } long result = loadLong(position); position = newPosition; return result; }
public final int getInt () { int newPosition = position + 4; if (newPosition > limit) { throw new BufferUnderflowException(); } int result = loadInt(position); position = newPosition; return result; }
public final short getShort () { int newPosition = position + 2; if (newPosition > limit) { throw new BufferUnderflowException(); } short result = loadShort(position); position = newPosition; return result; }
public final double getDouble () { return Numbers.longBitsToDouble(getLong()); }
public final float getFloat (int index) { return Numbers.intBitsToFloat(getInt(index)); }
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(); } System.arraycopy(backingArray, offset + position, dest, off, len); position += len; return this; }
static ReadOnlyHeapByteBuffer copy (HeapByteBuffer other, int markOfOther) { ReadOnlyHeapByteBuffer buf = new ReadOnlyHeapByteBuffer(other.backingArray, other.capacity(), other.offset); buf.limit = other.limit(); buf.position = other.position(); buf.mark = markOfOther; buf.order(other.order()); return buf; }
public final long getLong () { int newPosition = position + 8; if (newPosition > limit) { throw new BufferUnderflowException(); } long result = loadLong(position); position = newPosition; return result; }