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

Commit 7254204c authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

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