public class TarGzOutputStream extends TarOutputStream
Modifier and Type | Field and Description |
---|---|
private ByteArrayOutputStream |
bos |
private TarEntry |
currentEntry |
private GZIPOutputStream |
gzip |
private TarOutputStream |
tos |
assemBuf, assemLen, buffer, currBytes, currSize, debug, oneBuf, recordBuf
out
Constructor and Description |
---|
TarGzOutputStream(OutputStream out) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Ends the TAR archive and closes the underlying OutputStream.
|
void |
closeEntry()
Close an entry.
|
void |
finish()
Ends the TAR archive without closing the underlying OutputStream.
|
int |
getRecordSize()
Get the record size being used by this stream's TarBuffer.
|
void |
putNextEntry(TarEntry entry)
Put an entry on the output stream.
|
void |
setBufferDebug(boolean b)
Sets the debugging flag in this stream's TarBuffer.
|
void |
setDebug(boolean b)
Sets the debugging flag.
|
void |
write(byte[] b)
Writes bytes to the current tar archive entry.
|
void |
write(byte[] b,
int start,
int length)
Writes bytes to the current tar archive entry.
|
void |
write(int b)
Writes a byte to the current tar archive entry.
|
flush
private TarOutputStream tos
private GZIPOutputStream gzip
private ByteArrayOutputStream bos
private TarEntry currentEntry
public TarGzOutputStream(OutputStream out) throws IOException
IOException
public void setDebug(boolean b)
TarOutputStream
setDebug
in class TarOutputStream
b
- True to turn on debugging.public void setBufferDebug(boolean b)
TarOutputStream
setBufferDebug
in class TarOutputStream
public void finish() throws IOException
TarOutputStream
finish
in class TarOutputStream
IOException
public void close() throws IOException
TarOutputStream
close
in interface Closeable
close
in interface AutoCloseable
close
in class TarOutputStream
IOException
public int getRecordSize()
TarOutputStream
getRecordSize
in class TarOutputStream
public void putNextEntry(TarEntry entry) throws IOException
TarOutputStream
putNextEntry
in class TarOutputStream
entry
- The TarEntry to be written to the archive.IOException
public void closeEntry() throws IOException
TarOutputStream
closeEntry
in class TarOutputStream
IOException
public void write(int b) throws IOException
TarOutputStream
write
in class TarOutputStream
b
- The byte written.IOException
public void write(byte[] b) throws IOException
TarOutputStream
write
in class TarOutputStream
b
- The buffer to write to the archive.IOException
public void write(byte[] b, int start, int length) throws IOException
TarOutputStream
write
in class TarOutputStream
b
- The buffer to write to the archive.start
- The offset in the buffer from which to get bytes.length
- The number of bytes to write.IOException
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses