public class TarGzOutputStream extends TarOutputStreamImpl
Modifier and Type | Field and Description |
---|---|
private java.io.ByteArrayOutputStream |
bos |
private TarEntry |
currentEntry |
private java.util.zip.GZIPOutputStream |
gzip |
private TarOutputStreamImpl |
tos |
Constructor and Description |
---|
TarGzOutputStream(java.io.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.
|
void |
flush() |
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.
|
private TarOutputStreamImpl tos
private java.util.zip.GZIPOutputStream gzip
private java.io.ByteArrayOutputStream bos
private TarEntry currentEntry
public TarGzOutputStream(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public void setDebug(boolean b)
TarOutputStreamImpl
setDebug
in class TarOutputStreamImpl
b
- True to turn on debugging.public void setBufferDebug(boolean b)
TarOutputStreamImpl
setBufferDebug
in class TarOutputStreamImpl
public void finish() throws java.io.IOException
TarOutputStreamImpl
finish
in class TarOutputStreamImpl
java.io.IOException
public void close() throws java.io.IOException
TarOutputStreamImpl
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class TarOutputStreamImpl
java.io.IOException
public int getRecordSize()
TarOutputStreamImpl
getRecordSize
in class TarOutputStreamImpl
public void putNextEntry(TarEntry entry) throws java.io.IOException
TarOutputStreamImpl
putNextEntry
in class TarOutputStreamImpl
entry
- The TarEntry to be written to the archive.java.io.IOException
public void closeEntry() throws java.io.IOException
TarOutputStreamImpl
closeEntry
in class TarOutputStreamImpl
java.io.IOException
public void write(int b) throws java.io.IOException
TarOutputStreamImpl
write
in class TarOutputStreamImpl
b
- The byte written.java.io.IOException
public void write(byte[] b) throws java.io.IOException
TarOutputStreamImpl
write
in class TarOutputStreamImpl
b
- The buffer to write to the archive.java.io.IOException
public void write(byte[] b, int start, int length) throws java.io.IOException
TarOutputStreamImpl
write
in class TarOutputStreamImpl
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.java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.FilterOutputStream
java.io.IOException
FilterOutputStream.flush()