ArchiveEntry consumed.
write(byte[], int, int) method to improve performance. They should also override
close() to ensure that any necessary trailers are added.
The normal sequence of calls when working with ArchiveOutputStreams is:
putArchiveEntry(ArchiveEntry) (writes entry header),
write(byte[]) (writes entry data, as often as needed),
closeArchiveEntry() (closes entry),
finish() (ends the addition of entries),close().| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | |
| private long | bytesWritten
Holds the number of bytes written to this stream. |
| private final byte[] | oneByte
Temporary buffer used for the |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: This implementation always returns true.the entry to test archiveEntry)Whether this stream is able to write the given entry. |
| public abstract void | |
| protected void | |
| protected void | count(final long
the number of bytes written written)Increments the counter of already written bytes. |
| public abstract E | Returns: the ArchiveEntry set up with details from the filethe file to create the entry from inputFile, String name to use for the entry entryName)Creates an archive entry using the inputFile and entryName provided. |
| public E | Returns: the ArchiveEntry set up with details from the filethe file to create the entry from inputPath, final String name to use for the entry entryName, final LinkOption... options indicating how symbolic links are handled. options)Creates an archive entry using the inputPath and entryName provided. |
| public abstract void | |
| public long | Returns: the number of written bytesGets the current number of bytes written to this stream. |
| public int | Returns: the number of written bytes
Deprecated
this method may yield wrong results for large archives, use #getBytesWritten instead
Gets the current number of bytes written to this stream.
|
| public abstract void | putArchiveEntry(E
describes the entry entry)Writes the headers for an archive entry to the output stream. |
| public void | write(final int
The byte to be written. b)Implements abstract java. |
| BYTE_MASK | back to summary |
|---|---|
| pack-priv static final int BYTE_MASK | |
| bytesWritten | back to summary |
|---|---|
| private long bytesWritten Holds the number of bytes written to this stream. | |
| oneByte | back to summary |
|---|---|
| private final byte[] oneByte Temporary buffer used for the | |
| ArchiveOutputStream | back to summary |
|---|---|
| public ArchiveOutputStream() | |
| canWriteEntryData | back to summary |
|---|---|
| public boolean canWriteEntryData(final ArchiveEntry archiveEntry) Whether this stream is able to write the given entry. Some archive formats support variants or details that are not supported (yet).
| |
| closeArchiveEntry | back to summary |
|---|---|
| public abstract void closeArchiveEntry() throws IOException Closes the archive entry, writing any trailer information that may be required.
| |
| count | back to summary |
|---|---|
| protected void count(final int written) Increments the counter of already written bytes. Doesn't increment if EOF has been hit (
| |
| count | back to summary |
|---|---|
| protected void count(final long written) Increments the counter of already written bytes. Doesn't increment if EOF has been hit (
| |
| createArchiveEntry | back to summary |
|---|---|
| public abstract E createArchiveEntry(File inputFile, String entryName) throws IOException Creates an archive entry using the inputFile and entryName provided.
| |
| createArchiveEntry | back to summary |
|---|---|
| public E createArchiveEntry(final Path inputPath, final String entryName, final LinkOption... options) throws IOException Creates an archive entry using the inputPath and entryName provided. The default implementation calls simply delegates as: return createArchiveEntry(inputFile.toFile(), entryName); Subclasses should override this method.
| |
| finish | back to summary |
|---|---|
| public abstract void finish() throws IOException Finishes the addition of entries to this stream, without closing it. Additional data can be written, if the format supports it.
| |
| getBytesWritten | back to summary |
|---|---|
| public long getBytesWritten() Gets the current number of bytes written to this stream.
| |
| getCount | back to summary |
|---|---|
| public int getCount()
Deprecated this method may yield wrong results for large archives, use #getBytesWritten instead Gets the current number of bytes written to this stream.
| |
| putArchiveEntry | back to summary |
|---|---|
| public abstract void putArchiveEntry(E entry) throws IOException Writes the headers for an archive entry to the output stream. The caller must then write the content to the stream and call
| |
| write | back to summary |
|---|---|
| public void write(final int b) throws IOException Implements abstract java. Writes a byte to the current archive entry.
This method simply calls
MUST be overridden if the
| |