diff --git a/src/main/java/software/coley/llzip/part/CentralDirectoryFileHeader.java b/src/main/java/software/coley/llzip/part/CentralDirectoryFileHeader.java index b0010e5..5dd6dee 100644 --- a/src/main/java/software/coley/llzip/part/CentralDirectoryFileHeader.java +++ b/src/main/java/software/coley/llzip/part/CentralDirectoryFileHeader.java @@ -220,7 +220,7 @@ public long getCompressedSize() { * Compressed size of {@link LocalFileHeader#getFileData()}. */ public void setCompressedSize(long compressedSize) { - this.compressedSize = compressedSize & 0xffffffffL; + this.compressedSize = compressedSize & 0xFFFFFFFFL; } /** @@ -239,7 +239,7 @@ public long getUncompressedSize() { * Uncompressed size after {@link LocalFileHeader#decompress(Decompressor)} is used on {@link LocalFileHeader#getFileData()}. */ public void setUncompressedSize(long uncompressedSize) { - this.uncompressedSize = uncompressedSize & 0xffffffffL; + this.uncompressedSize = uncompressedSize & 0xFFFFFFFFL; } /** @@ -254,7 +254,7 @@ public int getFileNameLength() { * Length of {@link #getFileName()}. */ public void setFileNameLength(int fileNameLength) { - this.fileNameLength = fileNameLength & 0xffff; + this.fileNameLength = fileNameLength & 0xFFFF; } /** @@ -269,7 +269,7 @@ public int getExtraFieldLength() { * Length of {@link #getExtraField()} */ public void setExtraFieldLength(int extraFieldLength) { - this.extraFieldLength = extraFieldLength & 0xffff; + this.extraFieldLength = extraFieldLength & 0xFFFF; } /** @@ -284,7 +284,7 @@ public int getFileCommentLength() { * Length of {@link #getFileComment()}. */ public void setFileCommentLength(int fileCommentLength) { - this.fileCommentLength = fileCommentLength & 0xffff; + this.fileCommentLength = fileCommentLength & 0xFFFF; } /** @@ -357,7 +357,7 @@ public long getRelativeOffsetOfLocalHeader() { * This should also be where the {@link LocalFileHeader} is located. Or {@code 0xFFFFFFFF} for ZIP64. */ public void setRelativeOffsetOfLocalHeader(long relativeOffsetOfLocalHeader) { - this.relativeOffsetOfLocalHeader = relativeOffsetOfLocalHeader & 0xffffffffL; + this.relativeOffsetOfLocalHeader = relativeOffsetOfLocalHeader & 0xFFFFFFFFL; } /** diff --git a/src/main/java/software/coley/llzip/part/EndOfCentralDirectory.java b/src/main/java/software/coley/llzip/part/EndOfCentralDirectory.java index b6cd247..aae4fb6 100644 --- a/src/main/java/software/coley/llzip/part/EndOfCentralDirectory.java +++ b/src/main/java/software/coley/llzip/part/EndOfCentralDirectory.java @@ -125,7 +125,7 @@ public long getCentralDirectorySize() { * Size of central directory in bytes, or {@code 0xFFFFFFFF} for ZIP64. */ public void setCentralDirectorySize(long centralDirectorySize) { - this.centralDirectorySize = centralDirectorySize & 0xffffffffL; + this.centralDirectorySize = centralDirectorySize & 0xFFFFFFFFL; } /** @@ -142,7 +142,7 @@ public long getCentralDirectoryOffset() { * {@link #getCentralDirectoryStartDisk() starting disk number}, or {@code 0xFFFFFFFF} for ZIP64. */ public void setCentralDirectoryOffset(long centralDirectoryOffset) { - this.centralDirectoryOffset = centralDirectoryOffset & 0xffffffffL; + this.centralDirectoryOffset = centralDirectoryOffset & 0xFFFFFFFFL; } /** @@ -157,7 +157,7 @@ public int getZipCommentLength() { * {@link #getZipComment() Comment} length. */ public void setZipCommentLength(int zipCommentLength) { - this.zipCommentLength = zipCommentLength & 0xffff; + this.zipCommentLength = zipCommentLength & 0xFFFF; } /** diff --git a/src/main/java/software/coley/llzip/part/JvmLocalFileHeader.java b/src/main/java/software/coley/llzip/part/JvmLocalFileHeader.java index b0c4811..0057111 100644 --- a/src/main/java/software/coley/llzip/part/JvmLocalFileHeader.java +++ b/src/main/java/software/coley/llzip/part/JvmLocalFileHeader.java @@ -49,9 +49,9 @@ public void link(CentralDirectoryFileHeader directoryFileHeader) { if (!foundPk) { long fileDataLength; if (getCompressionMethod() == ZipCompressions.STORED) { - fileDataLength = directoryFileHeader.getUncompressedSize() & 0xffffffffL; + fileDataLength = directoryFileHeader.getUncompressedSize() & 0xFFFFFFFFL; } else { - fileDataLength = directoryFileHeader.getCompressedSize() & 0xffffffffL; + fileDataLength = directoryFileHeader.getCompressedSize() & 0xFFFFFFFFL; } setFileData(data.sliceOf(offset, fileDataLength)); data = null; diff --git a/src/main/java/software/coley/llzip/part/LocalFileHeader.java b/src/main/java/software/coley/llzip/part/LocalFileHeader.java index c77d83d..1d8da31 100644 --- a/src/main/java/software/coley/llzip/part/LocalFileHeader.java +++ b/src/main/java/software/coley/llzip/part/LocalFileHeader.java @@ -207,7 +207,7 @@ public long getCompressedSize() { * Compressed size of {@link #getFileData()}. */ public void setCompressedSize(long compressedSize) { - this.compressedSize = compressedSize & 0xffffffffL; + this.compressedSize = compressedSize & 0xFFFFFFFFL; } /** @@ -226,7 +226,7 @@ public long getUncompressedSize() { * Uncompressed size after {@link #decompress(Decompressor)} is used on {@link #getFileData()}. */ public void setUncompressedSize(long uncompressedSize) { - this.uncompressedSize = uncompressedSize & 0xffffffffL; + this.uncompressedSize = uncompressedSize & 0xFFFFFFFFL; } /** @@ -241,7 +241,7 @@ public int getFileNameLength() { * Length of {@link #getFileName()}. */ public void setFileNameLength(int fileNameLength) { - this.fileNameLength = fileNameLength & 0xffff; + this.fileNameLength = fileNameLength & 0xFFFF; } /** @@ -256,7 +256,7 @@ public int getExtraFieldLength() { * Length of {@link #getExtraField()} */ public void setExtraFieldLength(int extraFieldLength) { - this.extraFieldLength = extraFieldLength & 0xffff; + this.extraFieldLength = extraFieldLength & 0xFFFF; } /**