-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge pull request #13 from iyxan23/12-cannot-handle-apk-file-size-2g
Showing
2 changed files
with
62 additions
and
26 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/com/iyxan23/zipalignjava/UnsignedByteBufferWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.iyxan23.zipalignjava; | ||
|
||
// A ByteBuffer wrapper for working with unsigned values | ||
|
||
import java.nio.ByteBuffer; | ||
|
||
class UnsignedByteBufferWrapper { | ||
private ByteBuffer inner; | ||
|
||
UnsignedByteBufferWrapper(ByteBuffer inner) { | ||
this.inner = inner; | ||
} | ||
|
||
public int getUShort() { | ||
return inner.getShort() & 0xffff; | ||
} | ||
|
||
public long getUInt() { | ||
return inner.getInt() & 0xffffffffL; | ||
} | ||
|
||
public int getUShort(int index) { | ||
return inner.getShort(index) & 0xffff; | ||
} | ||
|
||
public long getUInt(int index) { | ||
return inner.getInt(index) & 0xffffffffL; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters