Class
ZipEntryReader
public final class ZipEntryReader
A reader for the archive entry data stream.
Methods
close()
public func close()
Closes the file and invalidates ZipEntryReader
instance.
read(buf:count:)
@discardableResult public func read(buf: UnsafeMutableRawPointer, count: Int) throws -> Int
Reads at most count
bytes from file into buf
.
Returns number of bytes read.
Parameters
Name | Type | Description |
---|---|---|
buf | UnsafeMutableRawPointer |
destination data buffer |
count | Int |
buffer size |
read(buf:)
@discardableResult public func read(buf: UnsafeMutableRawBufferPointer) throws -> Int
Reads at most count
bytes from file into buf
.
Returns number of bytes read.
Parameters
Name | Type | Description |
---|---|---|
buf | UnsafeMutableRawBufferPointer |
destination data buffer |
seek(offset:relativeTo:)
public func seek(offset: Int, relativeTo whence: ZipWhence = .origin) throws
Seeks to the specified offset
relative to whence
, just like fseek(3)
Parameters
Name | Type | Description |
---|---|---|
offset | Int |
relative offset |
whence | ZipWhence |
anchor point |
tell()
public func tell() throws -> Int
Reports the current offset in the file. tell
only works on uncompressed (stored) data.
When called on compressed data it will throw an error.