elect
10/17/2023, 12:06 PMval path = "/home/elect/IdeaProjects/scifio-lifesci/test.sdt".toPath()
println(HostFileSystem.exists(path))
println(HostFileSystem.source(path).buffer().buffer.size)
> true
> 0
but test.sdt is not empty..
> -rw-rw-r-- 1 elect elect 4892652 ott 15 17:38 test.sdt
I have my logic expecting a Buffer
, that's what I understood is something I can "consume" (I need to read sequentially and sparse)mbonnin
10/17/2023, 12:13 PMHostFileSystem.source(path).buffer()
. The following will give you everything in memory
HostFileSystem.source(path).buffer().readUtf8()
HostFileSystem.source(path).buffer().readByteArray()
elect
10/17/2023, 12:14 PMBufferedSource
mbonnin
10/17/2023, 12:14 PMHostFileSystem.source(path).buffer().apply {
readByte()
readByte()
}
while(!bufferedSource.exhausted()) {
// read stuff
}
elect
10/17/2023, 12:17 PMelect
10/17/2023, 12:18 PMmbonnin
10/17/2023, 12:18 PMelect
10/17/2023, 12:18 PMmbonnin
10/17/2023, 12:18 PMporting to MP thisThen
BufferedSource
is the perfect fit, it should have all the readInt
, readShort
, etc..elect
10/17/2023, 12:19 PMmbonnin
10/17/2023, 12:26 PM