Initial implementation of APKINDEX, fetching, reading, parsing, & merging

This commit is contained in:
2024-11-08 21:22:33 +11:00
parent f6cbddb608
commit 941dfae317
18 changed files with 877 additions and 65 deletions

View File

@ -0,0 +1,21 @@
// SPDX-License-Identifier: Apache-2.0
import Foundation
public protocol InputStream: Stream, IteratorProtocol {
associatedtype Element = UInt8
mutating func read(_ count: Int) throws(StreamError) -> Data
}
public extension InputStream {
mutating func read(_ size: Int, items: Int) throws(StreamError) -> Data {
try self.read(size * items)
}
}
public extension InputStream {
mutating func next() -> UInt8? {
try? self.read(1).first
}
}