Class TarFile.BoundedTarEntryInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Enclosing class:
    TarFile

    private final class TarFile.BoundedTarEntryInputStream
    extends BoundedArchiveInputStream
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int read​(long pos, java.nio.ByteBuffer buf)
      Read content of the stream into a ByteBuffer.
      private int readArchive​(long pos, java.nio.ByteBuffer buf)  
      private int readSparse​(long pos, java.nio.ByteBuffer buf, int numToRead)  
      • 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
    • Field Detail

      • channel

        private final java.nio.channels.SeekableByteChannel channel
      • entryOffset

        private long entryOffset
      • currentSparseInputStreamIndex

        private int currentSparseInputStreamIndex
    • Constructor Detail

      • BoundedTarEntryInputStream

        BoundedTarEntryInputStream​(TarArchiveEntry entry,
                                   java.nio.channels.SeekableByteChannel channel)
                            throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • read

        protected int read​(long pos,
                           java.nio.ByteBuffer buf)
                    throws java.io.IOException
        Description copied from class: BoundedArchiveInputStream
        Read 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.
      • readSparse

        private int readSparse​(long pos,
                               java.nio.ByteBuffer buf,
                               int numToRead)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • readArchive

        private int readArchive​(long pos,
                                java.nio.ByteBuffer buf)
                         throws java.io.IOException
        Throws:
        java.io.IOException