public class Leb128 extends Object
| Constructor and Description |
|---|
Leb128() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
readByteArray(InputStream is)
Read a byte array prepended with a LEB 128 u64 indicated its length Warning: the maximum array size is 2^31
|
static long |
readU64(InputStream is)
Read an u64 encoded as an LEB 128 from a stream
|
static void |
writeArray(OutputStream os,
byte[] array)
Write a byte array prepended with a LEB128 u64 indicating its length
|
static void |
writeU64(OutputStream os,
long value)
Write a u64 as an LEB128
|
public static void writeU64(OutputStream os, long value) throws IOException
os - the OutputStream to write tovalue - the value to writeIOException - if the stream is in errorpublic static long readU64(InputStream is) throws IOException
is - the InputStream to read fromIOException - if the stream is in errorpublic static byte[] readByteArray(InputStream is) throws IOException
is - the InputStream to read the array fromIOException - if the stream is in error or the number of bytes read is not the expected valuepublic static void writeArray(OutputStream os, byte[] array) throws IOException
os - the OutputStream to write toarray - the array to writeIOException - is the stream is in errorCopyright © 2023. All rights reserved.