public class TarOutputStream
- Object
- OutputStream
- BufferedOutputStream
- TarOutputStream
ImplementsAutoCloseable
Constructors
public TarOutputStream(OutputStream out) |
Methods
public void close()
throws IOException | Appends the EOF record and closes the stream |
public void write(int b)
throws IOException | Writes a byte to the stream and updates byte counters |
public void write(byte[] b, int off, int len)
throws IOException | Checks if the bytes being written exceed the current entry size. |
public void putNextEntry(TarEntry entry)
throws IOException | Writes the next tar entry header on the stream |
protected void closeCurrentEntry()
throws IOException | Closes the current tar entry |
protected void pad()
throws IOException | Pads the last content block |
Inherited fields
From BufferedOutputStream
Inherited methods
Constructor details
TarOutputStream
public TarOutputStream(OutputStream out)Method details
close
public void close()
throws IOExceptionAppends the EOF record and closes the stream
Throws
IOException- if an I/O error occurs.
See also
java.io.FilterOutputStream#close()
write
public void write(int b)
throws IOExceptionWrites a byte to the stream and updates byte counters
Parameters
bint- the byte to be written.
Throws
IOException- if an I/O error occurs.
See also
java.io.FilterOutputStream#write(int)
write
public void write(byte[] b, int off, int len)
throws IOExceptionChecks if the bytes being written exceed the current entry size.
Parameters
bbyte[]- the data.
offint- the start offset in the data.
lenint- the number of bytes to write.
Throws
IOException- if an I/O error occurs.
See also
java.io.FilterOutputStream#write(byte[], int, int)
putNextEntry
public void putNextEntry(TarEntry entry)
throws IOExceptionWrites the next tar entry header on the stream
Throws
closeCurrentEntry
protected void closeCurrentEntry()
throws IOExceptionCloses the current tar entry
Throws
pad
protected void pad()
throws IOExceptionPads the last content block