public class ByteUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ByteUtil.MutLong
Mutable long integer.
|
| Constructor and Description |
|---|
ByteUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
readBoolean(int input,
int bitOffset) |
static int |
readInt(int input,
int bitOffset,
int bitCount)
Reads some bits from an integer and returns them as another integer, shifted right such that
the least significant extracted bit becomes the least significant bit in the output.
|
static long |
readLong(long input,
int bitOffset,
int bitCount) |
static byte |
toByte(int code) |
static int |
toInt(long code) |
static short |
toShort(long code) |
static int |
toUnsigned(byte code) |
static int |
toUnsigned(short code) |
static int |
write16(int dst,
int bitOffset,
int value) |
static int |
writeBool(int dst,
int bitOffset,
boolean value) |
static long |
writeBool(long dst,
int bitOffset,
boolean value) |
static int |
writeInt(int dst,
int bitOffset,
int bitLength,
int value) |
static long |
writeInt(long dst,
int bitOffset,
int bitLength,
int value) |
static long |
writeLong(long dst,
int bitOffset,
int bitLength,
long value) |
public static int readInt(int input,
int bitOffset,
int bitCount)
input - inputbitOffset - First bit to read. 0 is the most significant bit, 31 is the least significant
bitbitCount - number of bits to readpublic static long readLong(long input,
int bitOffset,
int bitCount)
public static boolean readBoolean(int input,
int bitOffset)
public static int writeInt(int dst,
int bitOffset,
int bitLength,
int value)
public static int write16(int dst,
int bitOffset,
int value)
public static int writeBool(int dst,
int bitOffset,
boolean value)
public static long writeInt(long dst,
int bitOffset,
int bitLength,
int value)
public static long writeLong(long dst,
int bitOffset,
int bitLength,
long value)
public static long writeBool(long dst,
int bitOffset,
boolean value)
public static byte toByte(int code)
public static short toShort(long code)
public static int toInt(long code)
public static int toUnsigned(byte code)
public static int toUnsigned(short code)
Copyright © 2024. All rights reserved.