# Class TarInputStream

java.lang.Object
java.io.InputStream
com.codename1.io.BufferedInputStream
com.codename1.io.tar.TarInputStream

All Implemented Interfaces:
  `AutoCloseable`

public class TarInputStream extends BufferedInputStream

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TarInputStream(InputStream in)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `closeCurrentEntry()`
  Closes the current tar entry
  `TarEntry`
  `getNextEntry()`
  Returns the next entry in the tar file
  `boolean`
  `isDefaultSkip()`
  `void`
  `mark(int readlimit)`
  Not supported
  `boolean`
  `markSupported()`
  Tests if this input stream supports the `mark` and `reset` methods.
  `int`
  `read()`
  Read a byte
  `int`
  `read(byte[] b, int off, int len)`
  Checks if the bytes being read exceed the entry size and adjusts the byte array length.
  `void`
  `reset()`
  Not supported
  `void`
  `setDefaultSkip(boolean defaultSkip)`
  `long`
  `skip(long n)`
  Skips 'n' bytes on the InputStream
  `protected void`
  `skipPad()`
  Skips the pad at the end of each tar entry file content

  ### Methods inherited from class BufferedInputStream

  `available, close, getConnection, getDefaultBufferSize, getInternal, getLastActivityTime, getName, getTotalBytesRead, getYield, isDisableBuffering, isPrintInput, read, setConnection, setDefaultBufferSize, setDisableBuffering, setPrintInput, setProgressListener, setYield, stop`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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)