Class TarOutputStream

All Implemented Interfaces:
AutoCloseable

public class TarOutputStream extends BufferedOutputStream
  • 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
      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