react-native-blob-util 0.19.9 → 0.19.10

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.
package/README.md CHANGED
@@ -951,6 +951,30 @@ public class MainApplication extends Application implements ReactApplication {
951
951
  }
952
952
  ````
953
953
 
954
+ #### Kotlin
955
+ ````kotlin
956
+ ....
957
+ import com.ReactNativeBlobUtil.ReactNativeBlobUtilUtils;
958
+ import javax.net.ssl.X509TrustManager
959
+ ...
960
+
961
+ public class MainApplication extends Application implements ReactApplication {
962
+ ...
963
+ public void onCreate() {
964
+ ...
965
+ ReactNativeBlobUtilUtils.sharedTrustManager = object : X509TrustManager {
966
+ override fun checkClientTrusted(chain: Array<java.security.cert.X509Certificate>, authType: String) {}
967
+
968
+ override fun checkServerTrusted(chain: Array<java.security.cert.X509Certificate>, authType: String) {}
969
+
970
+ override fun getAcceptedIssuers(): Array<java.security.cert.X509Certificate> {
971
+ return arrayOf()
972
+ }
973
+ };
974
+ ...
975
+ }
976
+ ````
977
+
954
978
  ```js
955
979
  ReactNativeBlobUtil.config({
956
980
  trusty: true
@@ -678,7 +678,7 @@ class ReactNativeBlobUtilFS {
678
678
  * @param end End byte offset
679
679
  * @param encode NOT IMPLEMENTED
680
680
  */
681
- static void slice(String path, String dest, int start, int end, String encode, Promise promise) {
681
+ static void slice(String path, String dest, long start, long end, String encode, Promise promise) {
682
682
  try {
683
683
  dest = ReactNativeBlobUtilUtils.normalizePath(dest);
684
684
 
@@ -696,13 +696,13 @@ class ReactNativeBlobUtilFS {
696
696
  return;
697
697
  }
698
698
  FileOutputStream out = new FileOutputStream(new File(dest));
699
- int skipped = (int) in.skip(start);
699
+ long skipped = in.skip(start);
700
700
  if (skipped != start) {
701
701
  promise.reject("EUNSPECIFIED", "Skipped " + skipped + " instead of the specified " + start + " bytes");
702
702
  return;
703
703
  }
704
704
  byte[] buffer = new byte[10240];
705
- int remain = end - start;
705
+ int remain = (int) (end - start);
706
706
  while (remain > 0) {
707
707
  int read = in.read(buffer, 0, 10240);
708
708
  if (read <= 0) {
@@ -294,7 +294,7 @@ class ReactNativeBlobUtilImpl {
294
294
  }
295
295
  }
296
296
 
297
- public void slice(String src, String dest, int start, int end, Promise promise) {
297
+ public void slice(String src, String dest, long start, long end, Promise promise) {
298
298
  ReactNativeBlobUtilFS.slice(src, dest, start, end, "", promise);
299
299
  }
300
300
 
@@ -198,7 +198,7 @@ public class ReactNativeBlobUtil extends NativeBlobUtilsSpec {
198
198
 
199
199
  @Override
200
200
  public void slice(String src, String dest, double start, double end, Promise promise) {
201
- delegate.slice(src, dest, (int) start, (int) end, promise);
201
+ delegate.slice(src, dest, (long) start, (long) end, promise);
202
202
  }
203
203
 
204
204
  @Override
@@ -174,8 +174,8 @@ public class ReactNativeBlobUtil extends ReactContextBaseJavaModule {
174
174
  }
175
175
 
176
176
  @ReactMethod
177
- public void slice(String src, String dest, int start, int end, Promise promise) {
178
- delegate.slice(src, dest, start, end, promise);
177
+ public void slice(String src, String dest, double start, double end, Promise promise) {
178
+ delegate.slice(src, dest, (long) start, (long) end, promise);
179
179
  }
180
180
 
181
181
  @ReactMethod