ArchiveOutputStream

Archive output stream implementations are expected to override the write 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:

  • Create ArchiveOutputStream object,
  • optionally write SFX header (Zip only),
  • repeat as needed:
  • finish (ends the addition of entries),
  • optionally write additional data, provided format supports it,
  • close.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open val bytesWritten: Long
holds the number of bytes written to this stream

Functions

Link copied to clipboard
open fun canWriteEntryData(archiveEntry: ArchiveEntry): Boolean
Whether this stream is able to write the given entry.
Link copied to clipboard
open fun close()
Link copied to clipboard
abstract fun closeArchiveEntry()
Closes the archive entry, writing any trailer information that may be required.
Link copied to clipboard
abstract fun createArchiveEntry(inputFile: File, entryName: String): ArchiveEntry
Create an archive entry using the inputFile and entryName provided.
Link copied to clipboard
abstract fun finish()
Finishes the addition of entries to this stream, without closing it.
Link copied to clipboard
open fun flush()
Link copied to clipboard
Link copied to clipboard
abstract fun putArchiveEntry(entry: ArchiveEntry)
Writes the headers for an archive entry to the output stream.
Link copied to clipboard
open fun write(b: Array<Byte>)

open fun write(b: Int)
Writes a byte to the current archive entry.