Hi all - recently found out okio is actually multi...
# squarelibraries
x
Hi all - recently found out okio is actually multiplatform. Are there any guides/sample-repos anyone able to find in using it in a multiplatform project?
m
Add
com.squareup.okio:okio-multiplatform:2.10.0
to your gradle script and the rest works pretty much like regular okio.
There are a some limitations listed here: https://square.github.io/okio/multiplatform/
x
Most of the use cases im used to in regular okio seems to be extending
<http://java.io|java.io>.File
, (such as
file.source().buffer()
) which i think is not available in multiplatform land 🤔 is that right?
m
While
File
is not multiplatform, there's some new stuff to do that kind of things in recent (maybe unreleased) version
The FileSystem API was introduced in 3.0.0-alpha1 : https://github.com/square/okio/blob/master/CHANGELOG.md#version-300-alpha1
You can try with
3.0.0-alpha4
which is the latest alpha as of today
x
i see - was digging through tests to workout how the multiplatform file system works, and best I could find was a
FileHandle
will give the new version a go - thanks @mbonnin 🙂