Skip to content

RNFetchBlob.fs.readStream - readChunk() or similar required #153

Open
@pstanton

Description

@pstanton

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions