Package jodd.util
Class Bits
- java.lang.Object
-
- jodd.util.Bits
-
public class Bits extends java.lang.ObjectPart a copy ofjava.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 Summary
Constructors Constructor Description Bits()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleangetBoolean(byte[] b, int off)static chargetChar(byte[] b, int off)static doublegetDouble(byte[] b, int off)static floatgetFloat(byte[] b, int off)static intgetInt(byte[] b, int off)static longgetLong(byte[] b, int off)static shortgetShort(byte[] b, int off)static booleanisSet(byte value, byte mask)static booleanisSet(int value, int mask)static booleannotSet(int value, int mask)static voidputBoolean(byte[] b, int off, boolean val)static voidputChar(byte[] b, int off, char val)static voidputDouble(byte[] b, int off, double val)static voidputFloat(byte[] b, int off, float val)static voidputInt(byte[] b, int off, int val)static voidputLong(byte[] b, int off, long val)static voidputShort(byte[] b, int off, short val)static byteset(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 intset(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).
-
-
-
Method Detail
-
getBoolean
public static boolean getBoolean(byte[] b, int off)
-
getChar
public static char getChar(byte[] b, int off)
-
getShort
public static short getShort(byte[] b, int off)
-
getInt
public static int getInt(byte[] b, int off)
-
getFloat
public static float getFloat(byte[] b, int off)
-
getLong
public static long getLong(byte[] b, int off)
-
getDouble
public static double getDouble(byte[] b, int off)
-
putBoolean
public static void putBoolean(byte[] b, int off, boolean val)
-
putChar
public static void putChar(byte[] b, int off, char val)
-
putShort
public static void putShort(byte[] b, int off, short val)
-
putInt
public static void putInt(byte[] b, int off, int val)
-
putFloat
public static void putFloat(byte[] b, int off, float val)
-
putLong
public static void putLong(byte[] b, int off, long val)
-
putDouble
public static void putDouble(byte[] b, int off, double val)
-
isSet
public static boolean isSet(byte value, byte mask)
-
isSet
public static boolean isSet(int value, int mask)
-
notSet
public static boolean notSet(int value, int mask)
-
set
public 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).
-
set
public 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).
-
-