OLEKit Documentation

Class Data​Reader

public final class DataReader: Reader  

A stateful stream that allows reading raw in-memory data in little-endian mode.

Properties

total​Bytes

public var totalBytes: Int  

Methods

seek(to​Offset:​)

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.

read​Data(of​Length:​)

public func readData(ofLength length: Int) -> Data  

Read a given count of bytes as raw data and increment byteOffset by count.

read​Data​ToEnd()

public func readDataToEnd() -> Data