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

Commit 8bac873a 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: 7e973443

am: 5a3d5db5

Change-Id: I5fb521a9d95ca7f35f95d2b6f4ec7c0c7c35cd4f
parents 9e979beb 5a3d5db5
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;
    }