ArchiveEntry

data class ArchiveEntry(val index: Int, val name: String, val size: Long, val compressedSize: Long, val isDirectory: Boolean, val crc: Long)(source)

Metadata describing a single file or directory entry within an archive.

Instances are retrieved via ArchiveReader.getEntries and passed to ArchiveReader.extractEntry (or the extract / extractToByteArray extensions) to decompress the entry's payload.

Constructors

Link copied to clipboard
constructor(index: Int, name: String, size: Long, compressedSize: Long, isDirectory: Boolean, crc: Long)

Properties

Link copied to clipboard

Compressed size of the entry in bytes as reported by the archive backend.

Link copied to clipboard
val crc: Long

Unsigned 32-bit CRC-32 checksum of the uncompressed entry data stored in the lower 32 bits, or 0 for formats that do not record per-entry CRC values (such as .tar.gz or .bz2).

Link copied to clipboard
val index: Int

Zero-based positional index of this entry within the archive's entry table.

Link copied to clipboard

true if this entry represents a directory; false if it represents a regular file.

Link copied to clipboard

Relative path of the entry inside the archive, normalized to use forward slashes (/).

Link copied to clipboard
val size: Long

Uncompressed size of the entry in bytes, or 0 for directories.

Functions

Link copied to clipboard
@ObjCName(name = "extract", swiftName = "extract")
fun ArchiveEntry.extract(reader: ArchiveReader, sink: Sink)

Extracts the uncompressed content of this entry from reader and writes it into sink.

Link copied to clipboard
@ObjCName(name = "extractToByteArray", swiftName = "extractToByteArray")
fun ArchiveEntry.extractToByteArray(reader: ArchiveReader): ByteArray

Extracts the uncompressed content of this entry from reader into a new in-memory ByteArray.