Class LongLEB128
java.lang.Object
com.pnfsoftware.jeb.util.encoding.LongLEB128
Read and write LEB128-encoded longs. An 8-byte long is encoded on 1 to 10 bytes.
For decoding only on byte arrays, use the highest-level utility methods in LEB128.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDecoded value along with the encoded length in bytes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LongLEB128.DecodedLongdecodeULEB128(InputStream input) Read an unsigned LEB128-encoded 64-bit integer and its encoded size.static longreadULEB128(InputStream input) Read an unsigned LEB128-encoded 64-bit integer.static voidwriteSLEB128(OutputStream out, long v) Write a signed LEB128-encoded 64-bit integer.static voidwriteULEB128(OutputStream out, long v) Write an unsigned LEB128-encoded 64-bit integer.
-
Constructor Details
-
LongLEB128
public LongLEB128()
-
-
Method Details
-
writeULEB128
Write an unsigned LEB128-encoded 64-bit integer.- Parameters:
out- output streamv- value to encode- Throws:
IOException- if the output stream cannot be written
-
readULEB128
Read an unsigned LEB128-encoded 64-bit integer.- Parameters:
input- input stream positioned at the encoded value- Returns:
- decoded value
- Throws:
IOException- if the value is malformed or cannot be fully read
-
decodeULEB128
Read an unsigned LEB128-encoded 64-bit integer and its encoded size.- Parameters:
input- input stream positioned at the encoded value- Returns:
- decoded value and encoded byte length
- Throws:
IOException- if the value is malformed or cannot be fully read
-
writeSLEB128
Write a signed LEB128-encoded 64-bit integer.- Parameters:
out- output streamv- value to encode- Throws:
IOException- if the output stream cannot be written
-