Class BinaryHeapInputStream

    • Constructor Detail

      • BinaryHeapInputStream

        public BinaryHeapInputStream​(byte[] data)
        Constructor.
        Parameters:
        data - Data.
    • Method Detail

      • create

        public static BinaryHeapInputStream create​(byte[] data,
                                                   int pos)
        Create stream with pointer set at the given position.
        Parameters:
        data - Data.
        pos - Position.
        Returns:
        Stream.
      • resize

        public byte[] resize​(int len)
        Method called from JNI to resize stream.
        Parameters:
        len - Required length.
        Returns:
        Underlying byte array.
      • 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.