Class FastByteArrayInputStream

    • Field Detail

      • array

        public byte[] array
        The array backing the input stream.
      • offset

        public int offset
        The first valid entry.
      • length

        public int length
        The number of valid bytes in array starting from offset.
    • Constructor Detail

      • FastByteArrayInputStream

        public FastByteArrayInputStream​(byte[] array,
                                        int offset,
                                        int length)
        Creates a new array input stream using a given array fragment.
        Parameters:
        array - the backing array.
        offset - the first valid entry of the array.
        length - the number of valid bytes.
      • FastByteArrayInputStream

        public FastByteArrayInputStream​(byte[] array)
        Creates a new array input stream using a given array.
        Parameters:
        array - the backing array.
    • Method Detail

      • mark

        public void mark​(int dummy)
        Overrides:
        mark in class InputStream
      • skip

        public long skip​(long n)
        Overrides:
        skip in class InputStream
      • position

        public void position​(long newPosition)
        Description copied from interface: RepositionableStream
        Sets the current stream position.
        Specified by:
        position in interface RepositionableStream
        Parameters:
        newPosition - the new stream position.
      • length

        public long length()
        Description copied from interface: MeasurableStream
        Returns the overall length of this stream (optional operation). In most cases, this will require the stream to perform some extra action, possibly changing the state of the input stream itself (typically, reading all the bytes up to the end, or flushing on output stream). Implementing classes should always document what state will the input stream be in after calling this method, and which kind of exception could be thrown.
        Specified by:
        length in interface MeasurableStream