public class TarOutputStream extends TarOutputStreamImpl
TarGzOutputStream, except the output is *not* encoded
with a GZIPOutputStream wrapper. In place temporarily until we determine a way to properly write entries and
automatically handle the proper "next entry" logic for TAR just as is done for TAR.GZ. Likely well centralize a lot
of this logic into a common base class.assemBuf, assemLen, buffer, currBytes, currSize, debug, oneBuf, recordBufout| Constructor and Description |
|---|
TarOutputStream(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.
|
public TarOutputStream(OutputStream out) throws IOException
IOExceptionpublic void setDebug(boolean b)
TarOutputStreamImplsetDebug in class TarOutputStreamImplb - True to turn on debugging.public void setBufferDebug(boolean b)
TarOutputStreamImplsetBufferDebug in class TarOutputStreamImplpublic void finish()
throws IOException
TarOutputStreamImplfinish in class TarOutputStreamImplIOExceptionpublic void close()
throws IOException
TarOutputStreamImplclose in interface Closeableclose in interface AutoCloseableclose in class TarOutputStreamImplIOExceptionpublic int getRecordSize()
TarOutputStreamImplgetRecordSize in class TarOutputStreamImplpublic void putNextEntry(TarEntry entry) throws IOException
TarOutputStreamImplputNextEntry in class TarOutputStreamImplentry - The TarEntry to be written to the archive.IOExceptionpublic void closeEntry()
throws IOException
TarOutputStreamImplcloseEntry in class TarOutputStreamImplIOExceptionpublic void write(int b)
throws IOException
TarOutputStreamImplwrite in class TarOutputStreamImplb - The byte written.IOExceptionpublic void write(byte[] b)
throws IOException
TarOutputStreamImplwrite in class TarOutputStreamImplb - The buffer to write to the archive.IOExceptionpublic void write(byte[] b,
int start,
int length)
throws IOException
TarOutputStreamImplwrite in class TarOutputStreamImplb - 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.IOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class FilterOutputStreamIOExceptionFilterOutputStream.flush()Copyright © 2013 JBoss by Red Hat. All Rights Reserved.