okio is a rich multi-platform library which introduces lots of support for working with files and streams, buffered streams, etc. Add implementation("com.squareup.okio:okio:3.2.0") to build.gradle.kts to add the library.
Problems:
The default unix impl of Source/Sink/UnixFileHandle accesses the file via CPointer<FILE>. We need int32_t fd to work with serial port's tcsetattr; yet we might use fileno
FileSource.file is private; can't access that via reflection :-D
Source/Sink are unidirectional while we need bidi; that can be worked around by following the example of Socket at https://square.github.io/okio/recipes/
I can implement a fd-based Source/Sink and bolt support for serial port on top of that; we could then still use the rich api goodness of Path and Buffered from okio.
okio is a rich multi-platform library which introduces lots of support for working with files and streams, buffered streams, etc. Add
implementation("com.squareup.okio:okio:3.2.0")
tobuild.gradle.kts
to add the library.Problems:
CPointer<FILE>
. We needint32_t fd
to work with serial port'stcsetattr
; yet we might use filenoFileSource.file
is private; can't access that via reflection :-D