|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream java.io.FilterOutputStream org.apache.tools.tar.TarOutputStream
public class TarOutputStream
The TarOutputStream writes a UNIX tar archive as an OutputStream. Methods are provided to put entries, and then write their contents by writing to this stream using write().
Field Summary | |
---|---|
protected byte[] |
assemBuf
|
protected int |
assemLen
|
protected TarBuffer |
buffer
|
protected long |
currBytes
|
protected java.lang.String |
currName
|
protected long |
currSize
|
protected boolean |
debug
|
static int |
LONGFILE_ERROR
Fail if a long file name is required in the archive. |
static int |
LONGFILE_GNU
GNU tar extensions are used to store long file names in the archive. |
static int |
LONGFILE_TRUNCATE
Long paths will be truncated in the archive. |
protected int |
longFileMode
|
protected byte[] |
oneBuf
|
protected byte[] |
recordBuf
|
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
TarOutputStream(java.io.OutputStream os)
Constructor for TarInputStream. |
|
TarOutputStream(java.io.OutputStream os,
int blockSize)
Constructor for TarInputStream. |
|
TarOutputStream(java.io.OutputStream os,
int blockSize,
int recordSize)
Constructor for TarInputStream. |
Method Summary | |
---|---|
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 debug)
Sets the debugging flag in this stream's TarBuffer. |
void |
setDebug(boolean debugF)
Sets the debugging flag. |
void |
setLongFileMode(int longFileMode)
Set the long file mode. |
void |
write(byte[] wBuf)
Writes bytes to the current tar archive entry. |
void |
write(byte[] wBuf,
int wOffset,
int numToWrite)
Writes bytes to the current tar archive entry. |
void |
write(int b)
Writes a byte to the current tar archive entry. |
Methods inherited from class java.io.FilterOutputStream |
---|
flush |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LONGFILE_ERROR
public static final int LONGFILE_TRUNCATE
public static final int LONGFILE_GNU
protected boolean debug
protected long currSize
protected java.lang.String currName
protected long currBytes
protected byte[] oneBuf
protected byte[] recordBuf
protected int assemLen
protected byte[] assemBuf
protected TarBuffer buffer
protected int longFileMode
Constructor Detail |
---|
public TarOutputStream(java.io.OutputStream os)
os
- the output stream to usepublic TarOutputStream(java.io.OutputStream os, int blockSize)
os
- the output stream to useblockSize
- the block size to usepublic TarOutputStream(java.io.OutputStream os, int blockSize, int recordSize)
os
- the output stream to useblockSize
- the block size to userecordSize
- the record size to useMethod Detail |
---|
public void setLongFileMode(int longFileMode)
longFileMode
- the mode to usepublic void setDebug(boolean debugF)
debugF
- True to turn on debugging.public void setBufferDebug(boolean debug)
debug
- True to turn on debugging.public void finish() throws java.io.IOException
java.io.IOException
- on errorpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.FilterOutputStream
java.io.IOException
- on errorpublic int getRecordSize()
public void putNextEntry(TarEntry entry) throws java.io.IOException
entry
- The TarEntry to be written to the archive.
java.io.IOException
- on errorpublic void closeEntry() throws java.io.IOException
java.io.IOException
- on errorpublic void write(int b) throws java.io.IOException
write
in class java.io.FilterOutputStream
b
- The byte written.
java.io.IOException
- on errorpublic void write(byte[] wBuf) throws java.io.IOException
write
in class java.io.FilterOutputStream
wBuf
- The buffer to write to the archive.
java.io.IOException
- on errorpublic void write(byte[] wBuf, int wOffset, int numToWrite) throws java.io.IOException
write
in class java.io.FilterOutputStream
wBuf
- The buffer to write to the archive.wOffset
- The offset in the buffer from which to get bytes.numToWrite
- The number of bytes to write.
java.io.IOException
- on error
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |