Class Buffer


public final class Buffer extends ReferenceCounted
  • Field Details

  • Constructor Details

    • Buffer

      public Buffer(boolean debug, String initialKey, MemoryAllocator allocator, long initialCapacity, long maxCapacity)
    • Buffer

      public Buffer(boolean debug, String initialKey, byte[] buffer)
    • Buffer

      public Buffer(boolean debug, String initialKey, MemorySegment segment)
  • Method Details

    • verifyAgainst

      public void verifyAgainst(MemorySegment seg, long segOff, long thisOff, long nBytes)
    • getMemoryAsBuffer

      public ByteBuffer getMemoryAsBuffer()
    • getBufferAsRead

      public ByteBuffer getBufferAsRead()
    • getBufferAsWriter

      public ByteBuffer getBufferAsWriter()
    • getMemoryAsSegment

      public MemorySegment getMemoryAsSegment()
    • refCountZero

      protected void refCountZero()
      Specified by:
      refCountZero in class ReferenceCounted
    • isNative

      public boolean isNative()
    • getCurrentCapacity

      public long getCurrentCapacity()
    • getMaxCapacity

      public long getMaxCapacity()
    • getReaderIndex

      public long getReaderIndex()
    • setReaderIndex

      public void setReaderIndex(long readerIndex)
    • getWriterIndex

      public long getWriterIndex()
    • setWriterIndex

      public void setWriterIndex(long writerIndex)
    • setIndices

      public void setIndices(long readerIndex, long writerIndex)
    • clear

      public void clear()
    • clearAndFill

      public void clearAndFill(byte value)
    • getReadableBytes

      public long getReadableBytes()
    • shiftReaderToZero

      public long shiftReaderToZero()
    • getWritableBytes

      public long getWritableBytes()
    • getImmediatelyWritableBytes

      public long getImmediatelyWritableBytes()
    • copy

      public Buffer copy(boolean debug, String key)
    • copy

      public Buffer copy(boolean debug, String key, MemoryAllocator allocator)
    • getNativeAddress

      public long getNativeAddress()
    • getBackingHeapObject

      public Object getBackingHeapObject()
    • castIndexToInt

      public static int castIndexToInt(long idx)
    • unread

      public void unread(long by)
    • advanceWrite

      public long advanceWrite(long by)
    • ensureReadable

      public void ensureReadable(long bytes)
    • ensureImmediatelyWritable

      public void ensureImmediatelyWritable(long bytes)
    • ensureCapacity

      public void ensureCapacity(long bytes)
    • readByte

      public byte readByte()
    • readByte

      public byte readByte(long index)
    • readBytes

      public void readBytes(byte[] dst, int off, int len)
    • readBytes

      public void readBytes(long index, byte[] dst, int off, int len)
    • readShortNO

      public short readShortNO()
    • readShortNO

      public short readShortNO(long index)
    • readShortsNO

      public void readShortsNO(short[] dst, int off, int len)
    • readShortsNO

      public void readShortsNO(long index, short[] dst, int off, int len)
    • readShortBE

      public short readShortBE()
    • readShortBE

      public short readShortBE(long index)
    • readShortsBE

      public void readShortsBE(short[] dst, int off, int len)
    • readShortsBE

      public void readShortsBE(long index, short[] dst, int off, int len)
    • readShortLE

      public short readShortLE()
    • readShortLE

      public short readShortLE(long index)
    • readShortsLE

      public void readShortsLE(short[] dst, int off, int len)
    • readShortsLE

      public void readShortsLE(long index, short[] dst, int off, int len)
    • readCharNO

      public char readCharNO()
    • readCharNO

      public char readCharNO(long index)
    • readCharsNO

      public void readCharsNO(char[] dst, int off, int len)
    • readCharsNO

      public void readCharsNO(long index, char[] dst, int off, int len)
    • readCharBE

      public char readCharBE()
    • readCharBE

      public char readCharBE(long index)
    • readCharsBE

      public void readCharsBE(char[] dst, int off, int len)
    • readCharsBE

      public void readCharsBE(long index, char[] dst, int off, int len)
    • readCharLE

      public char readCharLE()
    • readCharLE

      public char readCharLE(long index)
    • readCharsLE

      public void readCharsLE(char[] dst, int off, int len)
    • readCharsLE

      public void readCharsLE(long index, char[] dst, int off, int len)
    • readSignedMediumBE

      public int readSignedMediumBE()
    • readSignedMediumBE

      public int readSignedMediumBE(long index)
    • readSignedMediumsBE

      public void readSignedMediumsBE(int[] dst, int off, int len)
    • readSignedMediumsBE

      public void readSignedMediumsBE(long index, int[] dst, int off, int len)
    • readUnsignedMediumBE

      public int readUnsignedMediumBE()
    • readUnsignedMediumBE

      public int readUnsignedMediumBE(long index)
    • readUnsignedMediumsBE

      public void readUnsignedMediumsBE(int[] dst, int off, int len)
    • readUnsignedMediumsBE

      public void readUnsignedMediumsBE(long index, int[] dst, int off, int len)
    • readSignedMediumLE

      public int readSignedMediumLE()
    • readSignedMediumLE

      public int readSignedMediumLE(long index)
    • readSignedMediumsLE

      public void readSignedMediumsLE(int[] dst, int off, int len)
    • readSignedMediumsLE

      public void readSignedMediumsLE(long index, int[] dst, int off, int len)
    • readUnsignedMediumLE

      public int readUnsignedMediumLE()
    • readUnsignedMediumLE

      public int readUnsignedMediumLE(long index)
    • readUnsignedMediumsLE

      public void readUnsignedMediumsLE(int[] dst, int off, int len)
    • readUnsignedMediumsLE

      public void readUnsignedMediumsLE(long index, int[] dst, int off, int len)
    • readIntNO

      public int readIntNO()
    • readIntNO

      public int readIntNO(long index)
    • readIntsNO

      public void readIntsNO(int[] dst, int off, int len)
    • readIntsNO

      public void readIntsNO(long index, int[] dst, int off, int len)
    • readIntBE

      public int readIntBE()
    • readIntBE

      public int readIntBE(long index)
    • readIntsBE

      public void readIntsBE(int[] dst, int off, int len)
    • readIntsBE

      public void readIntsBE(long index, int[] dst, int off, int len)
    • readIntLE

      public int readIntLE()
    • readIntLE

      public int readIntLE(long index)
    • readIntsLE

      public void readIntsLE(int[] dst, int off, int len)
    • readIntsLE

      public void readIntsLE(long index, int[] dst, int off, int len)
    • readLongNO

      public long readLongNO()
    • readLongNO

      public long readLongNO(long index)
    • readLongsNO

      public void readLongsNO(long[] dst, int off, int len)
    • readLongsNO

      public void readLongsNO(long index, long[] dst, int off, int len)
    • readLongBE

      public long readLongBE()
    • readLongBE

      public long readLongBE(long index)
    • readLongsBE

      public void readLongsBE(long[] dst, int off, int len)
    • readLongsBE

      public void readLongsBE(long index, long[] dst, int off, int len)
    • readLongLE

      public long readLongLE()
    • readLongLE

      public long readLongLE(long index)
    • readLongsLE

      public void readLongsLE(long[] dst, int off, int len)
    • readLongsLE

      public void readLongsLE(long index, long[] dst, int off, int len)
    • readFloatNO

      public float readFloatNO()
    • readFloatNO

      public float readFloatNO(long index)
    • readFloatsNO

      public void readFloatsNO(float[] dst, int off, int len)
    • readFloatsNO

      public void readFloatsNO(long index, float[] dst, int off, int len)
    • readFloatBE

      public float readFloatBE()
    • readFloatBE

      public float readFloatBE(long index)
    • readFloatsBE

      public void readFloatsBE(float[] dst, int off, int len)
    • readFloatsBE

      public void readFloatsBE(long index, float[] dst, int off, int len)
    • readFloatLE

      public float readFloatLE()
    • readFloatLE

      public float readFloatLE(long index)
    • readFloatsLE

      public void readFloatsLE(float[] dst, int off, int len)
    • readFloatsLE

      public void readFloatsLE(long index, float[] dst, int off, int len)
    • readDoubleNO

      public double readDoubleNO()
    • readDoubleNO

      public double readDoubleNO(long index)
    • readDoublesNO

      public void readDoublesNO(double[] dst, int off, int len)
    • readDoublesNO

      public void readDoublesNO(long index, double[] dst, int off, int len)
    • readDoubleBE

      public double readDoubleBE()
    • readDoubleBE

      public double readDoubleBE(long index)
    • readDoublesBE

      public void readDoublesBE(double[] dst, int off, int len)
    • readDoublesBE

      public void readDoublesBE(long index, double[] dst, int off, int len)
    • readDoubleLE

      public double readDoubleLE()
    • readDoubleLE

      public double readDoubleLE(long index)
    • readDoublesLE

      public void readDoublesLE(double[] dst, int off, int len)
    • readDoublesLE

      public void readDoublesLE(long index, double[] dst, int off, int len)
    • decodeSignedVarInt

      public static int decodeSignedVarInt(int value)
    • readSignedVarInt

      public int readSignedVarInt()
    • readSignedVarInt

      public int readSignedVarInt(long index)
    • readUnsignedVarInt

      public int readUnsignedVarInt()
    • readUnsignedVarInt

      public int readUnsignedVarInt(long index)
    • decodeSignedVarLong

      public static long decodeSignedVarLong(long value)
    • readSignedVarLong

      public long readSignedVarLong()
    • readSignedVarLong

      public long readSignedVarLong(long index)
    • readUnsignedVarLong

      public long readUnsignedVarLong()
    • readUnsignedVarLong

      public long readUnsignedVarLong(long index)
    • readIntoChannel

      public long readIntoChannel(WritableByteChannel channel) throws IOException
      Throws:
      IOException
    • readIntoChannel

      public void readIntoChannel(WritableByteChannel channel, long nBytes) throws IOException
      Throws:
      IOException
    • readIntoFilePos

      public long readIntoFilePos(FileChannel channel, long filePos) throws IOException
      Throws:
      IOException
    • readIntoFilePos

      public void readIntoFilePos(FileChannel channel, long filePos, long nBytes) throws IOException
      Throws:
      IOException
    • skipRead

      public void skipRead(long nBytes)
    • readIntoBuffer

      public long readIntoBuffer(Buffer dst)
    • readIntoBuffer

      public void readIntoBuffer(Buffer dst, long nBytes)
    • readIntoByteBuffer

      public int readIntoByteBuffer(ByteBuffer dst)
    • readIntoByteBuffer

      public void readIntoByteBuffer(ByteBuffer dst, int nBytes)
    • readIntoSegment

      public long readIntoSegment(MemorySegment dst, long dstOff)
    • readIntoSegment

      public void readIntoSegment(MemorySegment dst, long dstOff, long nBytes)
    • writeByte

      public void writeByte(byte val)
    • writeByte

      public void writeByte(long index, byte val)
    • writeBytes

      public void writeBytes(byte[] src, int off, int len)
    • writeBytes

      public void writeBytes(long index, byte[] src, int off, int len)
    • writeShortNO

      public void writeShortNO(short val)
    • writeShortNO

      public void writeShortNO(long index, short val)
    • writeShortsNO

      public void writeShortsNO(short[] src, int off, int len)
    • writeShortsNO

      public void writeShortsNO(long index, short[] src, int off, int len)
    • writeShortBE

      public void writeShortBE(short val)
    • writeShortBE

      public void writeShortBE(long index, short val)
    • writeShortsBE

      public void writeShortsBE(short[] src, int off, int len)
    • writeShortsBE

      public void writeShortsBE(long index, short[] src, int off, int len)
    • writeShortLE

      public void writeShortLE(short val)
    • writeShortLE

      public void writeShortLE(long index, short val)
    • writeShortsLE

      public void writeShortsLE(short[] src, int off, int len)
    • writeShortsLE

      public void writeShortsLE(long index, short[] src, int off, int len)
    • writeCharNO

      public void writeCharNO(char val)
    • writeCharNO

      public void writeCharNO(long index, char val)
    • writeCharsNO

      public void writeCharsNO(char[] src, int off, int len)
    • writeCharsNO

      public void writeCharsNO(long index, char[] src, int off, int len)
    • writeCharBE

      public void writeCharBE(char val)
    • writeCharBE

      public void writeCharBE(long index, char val)
    • writeCharsBE

      public void writeCharsBE(char[] src, int off, int len)
    • writeCharsBE

      public void writeCharsBE(long index, char[] src, int off, int len)
    • writeCharLE

      public void writeCharLE(char val)
    • writeCharLE

      public void writeCharLE(long index, char val)
    • writeCharsLE

      public void writeCharsLE(char[] src, int off, int len)
    • writeCharsLE

      public void writeCharsLE(long index, char[] src, int off, int len)
    • writeMediumBE

      public void writeMediumBE(int medium)
    • writeMediumBE

      public void writeMediumBE(long index, int medium)
    • writeMediumsBE

      public void writeMediumsBE(int[] src, int off, int len)
    • writeMediumsBE

      public void writeMediumsBE(long index, int[] src, int off, int len)
    • writeMediumLE

      public void writeMediumLE(int medium)
    • writeMediumLE

      public void writeMediumLE(long index, int medium)
    • writeMediumsLE

      public void writeMediumsLE(int[] src, int off, int len)
    • writeMediumsLE

      public void writeMediumsLE(long index, int[] src, int off, int len)
    • writeIntNO

      public void writeIntNO(int val)
    • writeIntNO

      public void writeIntNO(long index, int val)
    • writeIntsNO

      public void writeIntsNO(int[] src, int off, int len)
    • writeIntsNO

      public void writeIntsNO(long index, int[] src, int off, int len)
    • writeIntBE

      public void writeIntBE(int val)
    • writeIntBE

      public void writeIntBE(long index, int val)
    • writeIntsBE

      public void writeIntsBE(int[] src, int off, int len)
    • writeIntsBE

      public void writeIntsBE(long index, int[] src, int off, int len)
    • writeIntLE

      public void writeIntLE(int val)
    • writeIntLE

      public void writeIntLE(long index, int val)
    • writeIntsLE

      public void writeIntsLE(int[] src, int off, int len)
    • writeIntsLE

      public void writeIntsLE(long index, int[] src, int off, int len)
    • writeLongNO

      public void writeLongNO(long val)
    • writeLongNO

      public void writeLongNO(long index, long val)
    • writeLongsNO

      public void writeLongsNO(long[] src, int off, int len)
    • writeLongsNO

      public void writeLongsNO(long index, long[] src, int off, int len)
    • writeLongBE

      public void writeLongBE(long val)
    • writeLongBE

      public void writeLongBE(long index, long val)
    • writeLongsBE

      public void writeLongsBE(long[] src, int off, int len)
    • writeLongsBE

      public void writeLongsBE(long index, long[] src, int off, int len)
    • writeLongLE

      public void writeLongLE(long val)
    • writeLongLE

      public void writeLongLE(long index, long val)
    • writeLongsLE

      public void writeLongsLE(long[] src, int off, int len)
    • writeLongsLE

      public void writeLongsLE(long index, long[] src, int off, int len)
    • writeFloatNO

      public void writeFloatNO(float val)
    • writeFloatNO

      public void writeFloatNO(long index, float val)
    • writeFloatsNO

      public void writeFloatsNO(float[] src, int off, int len)
    • writeFloatsNO

      public void writeFloatsNO(long index, float[] src, int off, int len)
    • writeFloatBE

      public void writeFloatBE(float val)
    • writeFloatBE

      public void writeFloatBE(long index, float val)
    • writeFloatsBE

      public void writeFloatsBE(float[] src, int off, int len)
    • writeFloatsBE

      public void writeFloatsBE(long index, float[] src, int off, int len)
    • writeFloatLE

      public void writeFloatLE(float val)
    • writeFloatLE

      public void writeFloatLE(long index, float val)
    • writeFloatsLE

      public void writeFloatsLE(float[] src, int off, int len)
    • writeFloatsLE

      public void writeFloatsLE(long index, float[] src, int off, int len)
    • writeDoubleNO

      public void writeDoubleNO(double val)
    • writeDoubleNO

      public void writeDoubleNO(long index, double val)
    • writeDoublesNO

      public void writeDoublesNO(double[] src, int off, int len)
    • writeDoublesNO

      public void writeDoublesNO(long index, double[] src, int off, int len)
    • writeDoubleBE

      public void writeDoubleBE(double val)
    • writeDoubleBE

      public void writeDoubleBE(long index, double val)
    • writeDoublesBE

      public void writeDoublesBE(double[] src, int off, int len)
    • writeDoublesBE

      public void writeDoublesBE(long index, double[] src, int off, int len)
    • writeDoubleLE

      public void writeDoubleLE(double val)
    • writeDoubleLE

      public void writeDoubleLE(long index, double val)
    • writeDoublesLE

      public void writeDoublesLE(double[] src, int off, int len)
    • writeDoublesLE

      public void writeDoublesLE(long index, double[] src, int off, int len)
    • encodeSignedVarInt

      public static int encodeSignedVarInt(int value)
    • writeSignedVarInt

      public long writeSignedVarInt(int value)
    • writeSignedVarInt

      public long writeSignedVarInt(long index, int value)
    • writeUnsignedVarInt

      public long writeUnsignedVarInt(int value)
    • writeUnsignedVarInt

      public long writeUnsignedVarInt(long index, int value)
    • encodeSignedVarLong

      public static long encodeSignedVarLong(long value)
    • writeSignedVarLong

      public long writeSignedVarLong(long value)
    • writeSignedVarLong

      public long writeSignedVarLong(long index, long value)
    • writeUnsignedVarLong

      public long writeUnsignedVarLong(long value)
    • writeUnsignedVarLong

      public long writeUnsignedVarLong(long index, long value)
    • writeFromChannel

      public long writeFromChannel(ReadableByteChannel channel) throws IOException
      Throws:
      IOException
    • writeFromChannel

      public void writeFromChannel(ReadableByteChannel channel, long nBytes) throws IOException
      Throws:
      IOException
    • writeFromFilePos

      public long writeFromFilePos(FileChannel channel, long filePos) throws IOException
      Throws:
      IOException
    • writeFromFilePos

      public void writeFromFilePos(FileChannel channel, long filePos, long nBytes) throws IOException
      Throws:
      IOException
    • writeFromBuffer

      public long writeFromBuffer(Buffer src)
    • writeFromBuffer

      public void writeFromBuffer(Buffer src, long nBytes)
    • writeFromByteBuffer

      public int writeFromByteBuffer(ByteBuffer src)
    • writeFromByteBuffer

      public void writeFromByteBuffer(ByteBuffer src, int nBytes)
    • writeFromSegment

      public void writeFromSegment(MemorySegment src, long srcOff, long nBytes)
    • copy

      public static void copy(Buffer src, long srcPos, Buffer dst, long dstPos, long nBytes)