# Class TarOutputStream

java.lang.Object
java.io.OutputStream
com.codename1.io.BufferedOutputStream
com.codename1.io.tar.TarOutputStream

All Implemented Interfaces:
  `Closeable, Flushable, AutoCloseable`

public class TarOutputStream extends BufferedOutputStream

- ## Field Summary

  ### Fields inherited from class BufferedOutputStream

  `buf, count`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TarOutputStream(OutputStream out)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  Appends the EOF record and closes the stream
  `protected void`
  `closeCurrentEntry()`
  Closes the current tar entry
  `protected void`
  `pad()`
  Pads the last content block
  `void`
  `putNextEntry(TarEntry entry)`
  Writes the next tar entry header on the stream
  `void`
  `write(byte[] b, int off, int len)`
  Checks if the bytes being written exceed the current entry size.
  `void`
  `write(int b)`
  Writes a byte to the stream and updates byte counters

  ### Methods inherited from class BufferedOutputStream

  `flush, flushBuffer, getConnection, getDefaultBufferSize, getLastActivityTime, getName, getTotalBytesWritten, setConnection, setDefaultBufferSize, setProgressListener, write`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### TarOutputStream

    public TarOutputStream(OutputStream out)

- ## Method Details

  - ### close

    public void close() throws IOException

    Appends the EOF record and closes the stream

    ###### See also

    - java.io.FilterOutputStream#close()
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Overrides:
      `close` in class `BufferedOutputStream`
    Throws:
      `IOException`

  - ### write

    public void write(int b) throws IOException

    Writes a byte to the stream and updates byte counters

    ###### See also

    - java.io.FilterOutputStream#write(int)
    Overrides:
      `write` in class `BufferedOutputStream`
    Throws:
      `IOException`

  - ### write

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

    Checks if the bytes being written exceed the current entry size.

    ###### See also

    - java.io.FilterOutputStream#write(byte[], int, int)
    Overrides:
      `write` in class `BufferedOutputStream`
    Throws:
      `IOException`

  - ### putNextEntry

    public void putNextEntry(TarEntry entry) throws IOException

    Writes the next tar entry header on the stream

    ###### Parameters

    - `entry`

    ###### Throws

    - `IOException`
    Throws:
      `IOException`

  - ### closeCurrentEntry

    protected void closeCurrentEntry() throws IOException

    Closes the current tar entry

    ###### Throws

    - `IOException`
    Throws:
      `IOException`

  - ### pad

    protected void pad() throws IOException

    Pads the last content block

    ###### Throws

    - `IOException`
    Throws:
      `IOException`