You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
With recent support in RN for TypedArray's, is there a way (or planned support) for writing them directly, instead of base64 strings or normal arrays? For example, I tried something simple like:
const fs = RNFetchBlob.fs
const dirs = RNFetchBlob.fs.dirs
let path = dirs.DocumentDir + '/test.txt'
let arr = new Uint8Array(10)
fs.writeFile(path, arr, 'ascii')
.then(() => console.log("Wrote data to: " + path))
And this results in an Error: Expected "data" is an Array when encoding is "ascii", however got object. For now, I'm working around the issue by converting to a normal array like this:
However, I'm thinking there's some performance overhead to this, as it's creating a shallow copy of the entire array (not as bad as Base64 encoding I guess). Would it make sense to add support for RFNB to accept TypedArray's directly?