mirror of
https://github.com/GayPizzaSpecifications/darwin-apk.git
synced 2025-08-04 05:51:31 +00:00
yep steam classes are faster...
This commit is contained in:
@ -73,11 +73,11 @@ public struct ApkIndexUpdater {
|
||||
|
||||
var tars = [Data]()
|
||||
do {
|
||||
var file: any InputStream = try FileInputStream(indexURL)
|
||||
//var file: any InputStream = try MemoryInputStream(buffer: try Data(contentsOf: indexURL))
|
||||
var file = try FileInputStream(indexURL)
|
||||
//var file = try MemoryInputStream(buffer: try Data(contentsOf: indexURL))
|
||||
var gzip = GZipReader()
|
||||
tars.append(try gzip.read(inStream: &file))
|
||||
tars.append(try gzip.read(inStream: &file))
|
||||
tars.append(try gzip.read(inStream: file))
|
||||
tars.append(try gzip.read(inStream: file))
|
||||
} catch {
|
||||
fatalError(error.localizedDescription)
|
||||
}
|
||||
@ -85,10 +85,10 @@ public struct ApkIndexUpdater {
|
||||
print("Gzip time: \((ContinuousClock.now - gzipStart).formatted(durFormat))")
|
||||
let untarStart = ContinuousClock.now
|
||||
|
||||
var signatureStream = MemoryInputStream(buffer: tars[0])
|
||||
tarSignature = try TarReader.read(&signatureStream)
|
||||
var recordsStream = MemoryInputStream(buffer: tars[1])
|
||||
tarRecords = try TarReader.read(&recordsStream)
|
||||
let signatureStream = MemoryInputStream(buffer: tars[0])
|
||||
tarSignature = try TarReader.read(signatureStream)
|
||||
let recordsStream = MemoryInputStream(buffer: tars[1])
|
||||
tarRecords = try TarReader.read(recordsStream)
|
||||
|
||||
guard case .file(let signatureName, _) = tarSignature.first
|
||||
else { fatalError("Missing signature") }
|
||||
|
Reference in New Issue
Block a user