public class Bits
extends java.lang.Object
java.io.Bits
, which is for unknown reason package local.
Utility methods for packing/unpacking primitive values in/out of byte arrays
using big-endian byte ordering.Constructor and Description |
---|
Bits() |
Modifier and Type | Method and Description |
---|---|
static boolean |
getBoolean(byte[] b,
int off) |
static char |
getChar(byte[] b,
int off) |
static double |
getDouble(byte[] b,
int off) |
static float |
getFloat(byte[] b,
int off) |
static int |
getInt(byte[] b,
int off) |
static long |
getLong(byte[] b,
int off) |
static short |
getShort(byte[] b,
int off) |
static boolean |
isSet(byte value,
byte mask) |
static boolean |
isSet(int value,
int mask) |
static boolean |
notSet(int value,
int mask) |
static void |
putBoolean(byte[] b,
int off,
boolean val) |
static void |
putChar(byte[] b,
int off,
char val) |
static void |
putDouble(byte[] b,
int off,
double val) |
static void |
putFloat(byte[] b,
int off,
float val) |
static void |
putInt(byte[] b,
int off,
int val) |
static void |
putLong(byte[] b,
int off,
long val) |
static void |
putShort(byte[] b,
int off,
short val) |
static byte |
set(byte value,
byte mask,
boolean setBit)
Returns value with the bit corresponding to the mask set
(if setBit is true) or cleared (if setBit is false).
|
static int |
set(int value,
int mask,
boolean setBit)
Returns value with the bit corresponding to the mask set
(if setBit is true) or cleared (if setBit is false).
|
public static boolean getBoolean(byte[] b, int off)
public static char getChar(byte[] b, int off)
public static short getShort(byte[] b, int off)
public static int getInt(byte[] b, int off)
public static float getFloat(byte[] b, int off)
public static long getLong(byte[] b, int off)
public static double getDouble(byte[] b, int off)
public static void putBoolean(byte[] b, int off, boolean val)
public static void putChar(byte[] b, int off, char val)
public static void putShort(byte[] b, int off, short val)
public static void putInt(byte[] b, int off, int val)
public static void putFloat(byte[] b, int off, float val)
public static void putLong(byte[] b, int off, long val)
public static void putDouble(byte[] b, int off, double val)
public static boolean isSet(byte value, byte mask)
public static boolean isSet(int value, int mask)
public static boolean notSet(int value, int mask)
public static int set(int value, int mask, boolean setBit)
public static byte set(byte value, byte mask, boolean setBit)
Copyright © 2003-present Jodd Team