Class TarInputStream

All Implemented Interfaces:
Closeable, AutoCloseable

public class TarInputStream extends BufferedInputStream
  • Constructor Details

    • TarInputStream

      public TarInputStream(InputStream in)
  • Method Details

    • markSupported

      public boolean markSupported()
      Description copied from class: BufferedInputStream

      Tests if this input stream supports the mark and reset methods. The markSupported method of BufferedInputStream returns true.

      Returns
      Overrides:
      markSupported in class BufferedInputStream
      Returns:

      a boolean indicating if this stream type supports the mark and reset methods.

      See also
      • java.io.InputStream#mark(int)

      • java.io.InputStream#reset()

    • mark

      public void mark(int readlimit)
      Not supported
      Overrides:
      mark in class BufferedInputStream
    • reset

      public void reset() throws IOException
      Not supported
      Overrides:
      reset in class BufferedInputStream
      Throws:
      IOException
    • read

      public int read() throws IOException

      Read a byte

      See also
      • java.io.FilterInputStream#read()
      Overrides:
      read in class BufferedInputStream
      Returns:

      the next byte of data, or -1 if the end of the stream is reached.

      Throws
      • IOException: @throws IOException if this input stream has been closed by invoking its #close() method, or an I/O error occurs.
      Throws:
      IOException
    • read

      public int read(byte[] b, int off, int len) throws IOException

      Checks if the bytes being read exceed the entry size and adjusts the byte array length. Updates the byte counters

      See also
      • java.io.FilterInputStream#read(byte[], int, int)
      Overrides:
      read in class BufferedInputStream
      Returns:

      the number of bytes read, or -1 if the end of the stream has been reached.

      Throws
      • IOException: @throws IOException if this input stream has been closed by invoking its #close() method, or an I/O error occurs.
      Throws:
      IOException
    • getNextEntry

      public TarEntry getNextEntry() throws IOException

      Returns the next entry in the tar file

      Returns

      TarEntry

      Throws
      • IOException
      Throws:
      IOException
    • closeCurrentEntry

      protected void closeCurrentEntry() throws IOException

      Closes the current tar entry

      Throws
      • IOException
      Throws:
      IOException
    • skipPad

      protected void skipPad() throws IOException

      Skips the pad at the end of each tar entry file content

      Throws
      • IOException
      Throws:
      IOException
    • skip

      public long skip(long n) throws IOException

      Skips 'n' bytes on the InputStream

      Overrides default implementation of skip

      Overrides:
      skip in class BufferedInputStream
      Throws:
      IOException
    • isDefaultSkip

      public boolean isDefaultSkip()
    • setDefaultSkip

      public void setDefaultSkip(boolean defaultSkip)