|
@@ -248,9 +248,9 @@ public class RNFetchBlobFS {
|
248
|
248
|
CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder();
|
249
|
249
|
while ((cursor = fs.read(buffer)) != -1) {
|
250
|
250
|
encoder.encode(ByteBuffer.wrap(buffer).asCharBuffer());
|
251
|
|
- // if the data contains invalid characters the following lines will be
|
252
|
|
- // skipped.
|
253
|
251
|
String chunk = new String(buffer);
|
|
252
|
+ if(cursor != bufferSize)
|
|
253
|
+ chunk = chunk.substring(0, cursor);
|
254
|
254
|
emitStreamEvent(streamId, "data", chunk);
|
255
|
255
|
if(tick > 0)
|
256
|
256
|
SystemClock.sleep(tick);
|