Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b37f8673 authored by Hemant Gupta's avatar Hemant Gupta Committed by android-build-merger
Browse files

Merge "OPP: Fix file sending error by calculating size of file properly." am:...

Merge "OPP: Fix file sending error by calculating size of file properly." am: 7e973443 am: 5a3d5db5
am: 8bac873a

Change-Id: I09caf220ae47aacbeb1354b6b0cd233e427ad14a
parents 283fd8aa 8bac873a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -224,8 +224,10 @@ public class BluetoothOppSendFileInfo {
    private static long getStreamSize(FileInputStream is) throws IOException {
        long length = 0;
        byte unused[] = new byte[4096];
        while (is.available() > 0) {
            length += is.read(unused, 0, 4096);
        int bytesRead = is.read(unused, 0, 4096);
        while (bytesRead != -1) {
            length += bytesRead;
            bytesRead = is.read(unused, 0, 4096);
        }
        return length;
    }