RNFetchBlob.fs.readStream - readChunk() or similar required
I am trying to stream file data from the local file system, to another slower destination (in my case BLE).
I can't see a way to achieve this using the current API... I need to be able to request the next chunk of data when I am ready for it, which RNFetchBlobReadStream doesn't seem to allow.
I can't see how I can use onData() to serve this purpose, instead I would need to do something like the following:
let stream = await RNFetchBlob.fs.readStream(path, "base64", 512);
stream.open();
while (true) {
let chunk = await stream.readChunk();
if (!chunk) break;
await send(chunk);
}
Is there a way to achieve this functionality currently? If not, I suggest adding this implementation.
Going to need a close() as well, since the end may never be reached.
We are open to PRs if you would like to implement this functionality
@pstanton Hi Paul, Did you managed to solve your problem? I need to read lines of text one by one from a csv file and generate events myself.
@pstanton Please change buffer size to 511 and then check it should work because in my case I changed the buffersize from 102400 to 102399 and it worked like magic!