itinance / itinance/react-native-fs

After using readFile to read the external device file, the App crashes after ejecting the external device

Open
#1,038 0 comments 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.