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

Commit 638ae7fc 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: 7254204c

Change-Id: Ic161f0c05404d8003bbd53af5b03d109f38ffa35
parents 18e8fa83 7254204c
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;
    }