react-native-blob-util 0.19.2 → 0.19.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,6 +44,10 @@ if (isNewArchitectureEnabled()) {
44
44
  }
45
45
 
46
46
  android {
47
+ def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
48
+ if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
49
+ namespace "com.ronradtke.rnblobutil"
50
+ }
47
51
  compileSdkVersion safeExtGet('compileSdkVersion', 30)
48
52
  buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
49
53
  defaultConfig {
@@ -161,4 +165,4 @@ afterEvaluate { project ->
161
165
  }
162
166
  }
163
167
  }
164
- }
168
+ }
@@ -73,9 +73,10 @@ public class ReactNativeBlobUtilStream {
73
73
  InputStreamReader isr = new InputStreamReader(fs, Charset.forName("UTF-8"));
74
74
  BufferedReader reader = new BufferedReader(isr, chunkSize);
75
75
  char[] buffer = new char[chunkSize];
76
+ int numBytesRead;
76
77
  // read chunks of the string
77
- while (reader.read(buffer, 0, chunkSize) != -1) {
78
- String chunk = new String(buffer);
78
+ while ((numBytesRead = reader.read(buffer, 0, chunkSize)) != -1) {
79
+ String chunk = new String(buffer, 0, numBytesRead);
79
80
  emitStreamEvent(streamId, "data", chunk);
80
81
  if (tick > 0)
81
82
  SystemClock.sleep(tick);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-blob-util",
3
- "version": "0.19.2",
3
+ "version": "0.19.3",
4
4
  "description": "A module provides upload, download, and files access API. Supports file stream read/write for process large files.",
5
5
  "main": "index",
6
6
  "scripts": {