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

Commit 7818bf1a 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

am: 638ae7fc

Change-Id: I5fb521a9d95ca7f35f95d2b6f4ec7c0c7c35cd4f
parents 443436eb 638ae7fc
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;
    }