@Override public HeapBuffer put(byte[] src, int offset, int length) { if (remaining() < length) { throw new BufferOverflowException(); } System.arraycopy(src, offset, heap, this.offset + pos, length); pos += length; return this; }
@SuppressWarnings("deprecation") @Override public HeapBuffer put8BitString(final String s) { final int len = s.length(); if (remaining() < len) { throw new BufferOverflowException(); } s.getBytes(0, len, heap, offset + pos); pos += len; return this; }
@SuppressWarnings("deprecation") @Override public HeapBuffer put8BitString(final String s) { final int len = s.length(); if (remaining() < len) { throw new BufferOverflowException(); } s.getBytes(0, len, heap, offset + pos); pos += len; return this; }
@Override public int getInt() { if (remaining() < 4) { throw new BufferUnderflowException(); } final int i = Bits.getInt(heap, offset + pos, bigEndian); pos += 4; return i; }
@Override public HeapBuffer putLong(long value) { if (remaining() < 8) { throw new BufferUnderflowException(); } Bits.putLong(heap, offset + pos, value, bigEndian); pos += 8; return this; }
@Override public HeapBuffer putFloat(float value) { if (remaining() < 4) { throw new BufferUnderflowException(); } Bits.putFloat(heap, offset + pos, value, bigEndian); pos += 4; return this; }
@Override public HeapBuffer putChar(char value) { if (remaining() < 2) { throw new BufferUnderflowException(); } Bits.putChar(heap, offset + pos, value, bigEndian); pos += 2; return this; }
@Override public HeapBuffer putLong(long value) { if (remaining() < 8) { throw new BufferUnderflowException(); } Bits.putLong(heap, offset + pos, value, bigEndian); pos += 8; return this; }
@Override public int getInt() { if (remaining() < 4) { throw new BufferUnderflowException(); } final int i = Bits.getInt(heap, offset + pos, bigEndian); pos += 4; return i; }
@Override public HeapBuffer putFloat(float value) { if (remaining() < 4) { throw new BufferUnderflowException(); } Bits.putFloat(heap, offset + pos, value, bigEndian); pos += 4; return this; }
@Override public HeapBuffer putDouble(double value) { if (remaining() < 8) { throw new BufferUnderflowException(); } Bits.putDouble(heap, offset + pos, value, bigEndian); pos += 8; return this; }
@Override public HeapBuffer putInt(int value) { if (remaining() < 4) { throw new BufferUnderflowException(); } Bits.putInt(heap, offset + pos, value, bigEndian); pos += 4; return this; }
@Override public HeapBuffer putLong(long value) { if (remaining() < 8) { throw new BufferUnderflowException(); } Bits.putLong(heap, offset + pos, value, bigEndian); pos += 8; return this; }
@Override public double getDouble() { if (remaining() < 8) { throw new BufferUnderflowException(); } final double d = Bits.getDouble(heap, offset + pos, bigEndian); pos += 8; return d; }
@Override public HeapBuffer putDouble(double value) { if (remaining() < 8) { throw new BufferUnderflowException(); } Bits.putDouble(heap, offset + pos, value, bigEndian); pos += 8; return this; }
@Override public HeapBuffer putChar(char value) { if (remaining() < 2) { throw new BufferUnderflowException(); } Bits.putChar(heap, offset + pos, value, bigEndian); pos += 2; return this; }
@Override public HeapBuffer putShort(short value) { if (remaining() < 2) { throw new BufferUnderflowException(); } Bits.putShort(heap, offset + pos, value, bigEndian); pos += 2; return this; }
@Override public HeapBuffer putLong(long value) { if (remaining() < 8) { throw new BufferUnderflowException(); } Bits.putLong(heap, offset + pos, value, bigEndian); pos += 8; return this; }
@Override public HeapBuffer putFloat(float value) { if (remaining() < 4) { throw new BufferUnderflowException(); } Bits.putFloat(heap, offset + pos, value, bigEndian); pos += 4; return this; }
@Override public double getDouble() { if (remaining() < 8) { throw new BufferUnderflowException(); } final double d = Bits.getDouble(heap, offset + pos, bigEndian); pos += 8; return d; }