itinance / itinance/react-native-fs
After using readFile to read the external device file, the App crashes after ejecting the external device
Open
- Dominant language
- C++
- Stars
- 5k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
I see that the stream is not closed normally in the readFile method. Is this a bug?
this is code:
```java
public void readFile(String filepath, Promise promise) {
try {
InputStream inputStream = getInputStream(filepath);
byte[] inputData = getInputStreamBytes(inputStream);
String base64Content = Base64.encodeToString(inputData, Base64.NO_WRAP);
promise.resolve(base64Content);
} catch (Exception ex) {
ex.printStackTrace();
reject(promise, filepath, ex);
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.