org.xeustechnologies.jtar
Class TarOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.xeustechnologies.jtar.TarOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class TarOutputStream
extends java.io.FilterOutputStream

Author:
Kamran Zafar

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
TarOutputStream(java.io.OutputStream out)
           
 
Method Summary
 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 java.io.FilterOutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TarOutputStream

public TarOutputStream(java.io.OutputStream out)
Method Detail

close

public void close()
           throws java.io.IOException
Appends the EOF record and closes the stream

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.FilterOutputStream
Throws:
java.io.IOException
See Also:
FilterOutputStream.close()

write

public void write(int b)
           throws java.io.IOException
Writes a byte to the stream and updates byte counters

Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException
See Also:
FilterOutputStream.write(int)

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Checks if the bytes being written exceed the current entry size.

Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException
See Also:
FilterOutputStream.write(byte[], int, int)

putNextEntry

public void putNextEntry(TarEntry entry)
                  throws java.io.IOException
Writes the next tar entry header on the stream

Parameters:
entry -
Throws:
java.io.IOException

closeCurrentEntry

protected void closeCurrentEntry()
                          throws java.io.IOException
Closes the current tar entry

Throws:
java.io.IOException

pad

protected void pad()
            throws java.io.IOException
Pads the last content block

Throws:
java.io.IOException


Copyright © 2012 Xeus Technologies. All Rights Reserved.