Class
DataReader
public final class DataReader: Reader
A stateful stream that allows reading raw in-memory data in little-endian mode.
Properties
totalBytes
public var totalBytes: Int
Methods
seek(toOffset:)
public func seek(toOffset offset: Int)
read()
public func read() -> UInt8
Read a single byte from the stream and increment byteOffset
by 1.
read()
public func read() -> UInt16
Read two bytes in little-endian order as a single UInt16
value and
increment byteOffset
by 2.
read()
public func read() -> UInt32
Read four bytes in little-endian order as a single UInt32
value and
increment byteOffset
by 4.
readData(ofLength:)
public func readData(ofLength length: Int) -> Data
Read a given count
of bytes as raw data and increment byteOffset
by count
.
readDataToEnd()
public func readDataToEnd() -> Data