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
I had an issue when using readStream() with base64 files when using the default for the bufferSize parameter. The issue was that the file contents were corrupted. At first glance they looked the same, but readStream() was giving me some extra bytes that I didn't know where they were coming from.
bufferSize: number (optional)
Buffer size of read stream, default to 4096 and 4095(when encoding is base64)
And
when reading file in BASE64 encoding, buffer size must be multiples of 3.
I discovered that the issue is: When you omit the bufferSize argument, the default value is taken from class/ReactNativeBlobUtilReadStream.js, which sets the default to 10240 regardless of the encoding. This value is not good for base64, as it is not a multiple of 3.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
[email protected]
for the project I'm working on.I had an issue when using readStream() with base64 files when using the default for the bufferSize parameter. The issue was that the file contents were corrupted. At first glance they looked the same, but readStream() was giving me some extra bytes that I didn't know where they were coming from.
The docs state the following,
And
I discovered that the issue is: When you omit the bufferSize argument, the default value is taken from
class/ReactNativeBlobUtilReadStream.js
, which sets the default to 10240 regardless of the encoding. This value is not good for base64, as it is not a multiple of 3.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: