Class WrappedByteArrayInputStream

    • Constructor Detail

      • WrappedByteArrayInputStream

        public WrappedByteArrayInputStream​(byte[] buf)
        Create a new stream from the given buffer.
        Parameters:
        buf - The byte buffer.
      • WrappedByteArrayInputStream

        public WrappedByteArrayInputStream​(byte[] buf,
                                           int offset,
                                           int length)
        Create a new stream from the given buffer.
        Parameters:
        buf - The byte buffer.
        offset - The offset in the buffer of the first byte to read.
        length - The maximum number of bytes to read from the buffer.
    • Method Detail

      • length

        public long length()
        Returns the length of the underlying buffer (ie, the length of this stream).
        Returns:
        The length of the underlying buffer.
      • duplicate

        public InputStream duplicate()
        Description copied from interface: DuplicatableInputStream
        Produces a duplicate stream of the source (from its start) that can be used in parallel to the original stream (ie, thread safe).
        Specified by:
        duplicate in interface DuplicatableInputStream
        Returns:
        A new input stream instance.