Skip to content

Commit

Permalink
Tweak hex format to be capitalized
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Apr 25, 2022
1 parent 4f77b8c commit 9362c78
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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;
}

/**
Expand All @@ -254,7 +254,7 @@ public int getFileNameLength() {
* Length of {@link #getFileName()}.
*/
public void setFileNameLength(int fileNameLength) {
this.fileNameLength = fileNameLength & 0xffff;
this.fileNameLength = fileNameLength & 0xFFFF;
}

/**
Expand All @@ -269,7 +269,7 @@ public int getExtraFieldLength() {
* Length of {@link #getExtraField()}
*/
public void setExtraFieldLength(int extraFieldLength) {
this.extraFieldLength = extraFieldLength & 0xffff;
this.extraFieldLength = extraFieldLength & 0xFFFF;
}

/**
Expand All @@ -284,7 +284,7 @@ public int getFileCommentLength() {
* Length of {@link #getFileComment()}.
*/
public void setFileCommentLength(int fileCommentLength) {
this.fileCommentLength = fileCommentLength & 0xffff;
this.fileCommentLength = fileCommentLength & 0xFFFF;
}

/**
Expand Down Expand Up @@ -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;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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;
}

/**
Expand All @@ -157,7 +157,7 @@ public int getZipCommentLength() {
* {@link #getZipComment() Comment} length.
*/
public void setZipCommentLength(int zipCommentLength) {
this.zipCommentLength = zipCommentLength & 0xffff;
this.zipCommentLength = zipCommentLength & 0xFFFF;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/software/coley/llzip/part/LocalFileHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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;
}

/**
Expand All @@ -241,7 +241,7 @@ public int getFileNameLength() {
* Length of {@link #getFileName()}.
*/
public void setFileNameLength(int fileNameLength) {
this.fileNameLength = fileNameLength & 0xffff;
this.fileNameLength = fileNameLength & 0xFFFF;
}

/**
Expand All @@ -256,7 +256,7 @@ public int getExtraFieldLength() {
* Length of {@link #getExtraField()}
*/
public void setExtraFieldLength(int extraFieldLength) {
this.extraFieldLength = extraFieldLength & 0xffff;
this.extraFieldLength = extraFieldLength & 0xFFFF;
}

/**
Expand Down

0 comments on commit 9362c78

Please sign in to comment.