Class BoundedSeekableByteChannelInputStream

    • Constructor Summary

      Constructors 
      Constructor Description
      BoundedSeekableByteChannelInputStream​(long start, long remaining, java.nio.channels.SeekableByteChannel channel)
      Constructs a bounded stream on the underlying SeekableByteChannel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int read​(long pos, java.nio.ByteBuffer buf)
      Reads content of the stream into a ByteBuffer.
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BoundedSeekableByteChannelInputStream

        public BoundedSeekableByteChannelInputStream​(long start,
                                                     long remaining,
                                                     java.nio.channels.SeekableByteChannel channel)
        Constructs a bounded stream on the underlying SeekableByteChannel
        Parameters:
        start - Position in the stream from where the reading of this bounded stream starts
        remaining - Amount of bytes which are allowed to read from the bounded stream
        channel - Channel which the reads will be delegated to
    • Method Detail

      • read

        protected int read​(long pos,
                           java.nio.ByteBuffer buf)
                    throws java.io.IOException
        Description copied from class: BoundedArchiveInputStream
        Reads content of the stream into a ByteBuffer.
        Specified by:
        read in class BoundedArchiveInputStream
        Parameters:
        pos - position to start the read.
        buf - buffer to add the read content.
        Returns:
        number of read bytes.
        Throws:
        java.io.IOException - if I/O fails.