File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
android/src/main/java/com/ReactNativeBlobUtil Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -73,14 +73,13 @@ else if (resolved == null) {
7373 InputStreamReader isr = new InputStreamReader (fs , Charset .forName ("UTF-8" ));
7474 BufferedReader reader = new BufferedReader (isr , chunkSize );
7575 char [] buffer = new char [chunkSize ];
76+ int numBytesRead ;
7677 // read chunks of the string
77- int numBytesRead = reader .read (buffer , 0 , chunkSize );
78- while (numBytesRead != -1 ) {
78+ while ((numBytesRead = reader .read (buffer , 0 , chunkSize )) != -1 ) {
7979 String chunk = new String (buffer , 0 , numBytesRead );
8080 emitStreamEvent (streamId , "data" , chunk );
8181 if (tick > 0 )
8282 SystemClock .sleep (tick );
83- numBytesRead = reader .read (buffer , 0 , chunkSize );
8483 }
8584
8685 reader .close ();
You can’t perform that action at this time.
0 commit comments