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

Commit 829e0f5c authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "ZipUtils: use FileChannel#size" am: d0798d71 am: f9220155...

Merge "Merge "ZipUtils: use FileChannel#size" am: d0798d71 am: f9220155 am: 0c60cbf8 am: 1cbe6e0d"
parents 1a7efddd 3e705d0f
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -63,7 +63,8 @@ abstract class ZipUtils {
        // exactly the remaining bytes in the buffer. The search is bounded because the maximum
        // exactly the remaining bytes in the buffer. The search is bounded because the maximum
        // size of the comment field is 65535 bytes because the field is an unsigned 16-bit number.
        // size of the comment field is 65535 bytes because the field is an unsigned 16-bit number.


        long fileSize = zip.length();
        // TODO(b/193592496) RandomAccessFile#length
        long fileSize = zip.getChannel().size();
        if (fileSize < ZIP_EOCD_REC_MIN_SIZE) {
        if (fileSize < ZIP_EOCD_REC_MIN_SIZE) {
            return null;
            return null;
        }
        }
@@ -110,7 +111,8 @@ abstract class ZipUtils {
            throw new IllegalArgumentException("maxCommentSize: " + maxCommentSize);
            throw new IllegalArgumentException("maxCommentSize: " + maxCommentSize);
        }
        }


        long fileSize = zip.length();
        // TODO(b/193592496) RandomAccessFile#length
        long fileSize = zip.getChannel().size();
        if (fileSize < ZIP_EOCD_REC_MIN_SIZE) {
        if (fileSize < ZIP_EOCD_REC_MIN_SIZE) {
            // No space for EoCD record in the file.
            // No space for EoCD record in the file.
            return null;
            return null;