I was curious in Okio, if there are any plans to b...
# squarelibraries
a
I was curious in Okio, if there are any plans to bring the Gzip classes to any targets other than JVM?
j
It's not free on other platforms like it is on the JVM
Perhaps as an add-on module with dependencies
a
ah that makes sense
j
There’s actually some platforms with built in stuff
What platforms are you interested in?!
a
iOS is the main one for now, but WASM later
for iOS I pulled in Korge Core lib which has iOS support, but that's a pro hefty boi for just zip file handling
j
Do you want zip or gzip?
Zip is pretty straightforward that we could just write it in common Kotlin
a
yeah I typed the wrong thing at first 🤦‍♂️ My particular use case is navigating and extracting a zip file
j
Fits nicely into Okio's filesystem which should be able to mount a zip
It probably already supports this. I can't remember
a
I think when I looked into it mounting a zip file was only for JVM targets
I'm using okio for the rest of my projects file access so that would indeed be pretty great to also have for the rest of the targets
j
Parsing the happy path of zip is super easy
Although we wouldn't be able to decompress since we need deflate
e
Gzip would be nice 😅
j
File and/or thumbs up issues
a
doesn't look like there's an issue open on it, so I created one: https://github.com/square/okio/issues/1408
thank you color 2
lol... I sat down to write a simple zip extractor, and thought HEY, lets try out this AI thing everyone is going on about. So I asked it to write some kotlin to read zip file entry headers, and it produced this:
Copy code
fun readLocalFileHeader(input: Input): LocalFileHeader {
    // Implement logic to read the local file header according to ZIP file specification
    // This involves reading the ZIP file structure, parsing the local file header fields etc.
    // Return a LocalFileHeader object with relevant information
}

data class LocalFileHeader(
    val fileName: String,
    val compressedSize: Long,
    val uncompressedSize: Long
    // include other relevant fields as needed
)
so... we're safe for now lol
k
Did it just give you an empty function with some comments? (On mobile ATM). That's hilarious.
a
lol yup