Class BinaryOffheapInputStream

    • Constructor Detail

      • BinaryOffheapInputStream

        public BinaryOffheapInputStream​(long ptr,
                                        int cap)
        Constructor.
        Parameters:
        ptr - Pointer.
        cap - Capacity.
      • BinaryOffheapInputStream

        public BinaryOffheapInputStream​(long ptr,
                                        int cap,
                                        boolean forceHeap)
        Constructor.
        Parameters:
        ptr - Pointer.
        cap - Capacity.
        forceHeap - If true method offheapPointer() returns 0 and unmarshalling will create heap-based objects.
    • Method Detail

      • remaining

        public int remaining()
        Gets amount of remaining data in bytes.
        Returns:
        Remaining data.
      • capacity

        public int capacity()
        Returns:
        Total capacity.
      • array

        public byte[] array()
        Returns:
        Underlying array.
      • arrayCopy

        public byte[] arrayCopy()
        Returns:
        Copy of data in the stream.
      • hasArray

        public boolean hasArray()
        Returns:
        True is stream is array based.
      • copyAndShift

        protected void copyAndShift​(Object target,
                                    long off,
                                    int len)
        Copy data to target object shift position afterwards.
        Specified by:
        copyAndShift in class BinaryAbstractInputStream
        Parameters:
        target - Target.
        off - Offset.
        len - Length.
      • readBytePositioned0

        protected byte readBytePositioned0​(int pos)
        Internal routine for positioned byte value read.
        Specified by:
        readBytePositioned0 in class BinaryAbstractInputStream
        Parameters:
        pos - Position.
        Returns:
        Int value.
      • readShortPositioned0

        protected short readShortPositioned0​(int pos)
        Internal routine for positioned short value read.
        Specified by:
        readShortPositioned0 in class BinaryAbstractInputStream
        Parameters:
        pos - Position.
        Returns:
        Int value.
      • readIntPositioned0

        protected int readIntPositioned0​(int pos)
        Internal routine for positioned int value read.
        Specified by:
        readIntPositioned0 in class BinaryAbstractInputStream
        Parameters:
        pos - Position.
        Returns:
        Int value.