Structure
CPIOArchiveReader
public struct CPIOArchiveReader
CPIOArchiveReader
reads cpio
files.
let bytes = Array<UInt8>(try Data(contentsOf: myURL))
let reader = try CPIOArchiveReader(archive: bytes)
let bytes = reader[0]
let header = reader.headers[0]
Relationships
Conforms To
Sequence
Initializers
init(archive:)
public init(archive: [UInt8]) throws
The initializer reads all the cpio
headers in preparation for random access to the header's file contents later.
Parameters
Name | Type | Description |
---|---|---|
archive | [UInt8] |
The bytes of the archive you want to read. |
Throws
ArArchiveError
.
Properties
headers
public var headers: [Header] = []
The headers that describe the files in this archive.
Use this to find a file in the archive, then use the provided subscript to get the bytes of the file.
let bytes = Array<UInt8>(try Data(contentsOf: myURL))
let reader = try CPIOArchiveReader(archive: bytes)
let bytes = reader[header: reader.headers[0]]
// Use bytes...
Methods
makeIterator()
public func makeIterator() -> CPIOArchiveReaderIterator