public final class ByteUtil extends Object
Modifier and Type | Method and Description |
---|---|
static int |
combineToInt(short x,
short y) |
static long |
combineToLong(int x,
int y) |
static byte[] |
concatenate(byte[] a,
byte[] b) |
static int |
extractInt(long value,
boolean lowerBits) |
static short |
extractShort(int value,
boolean lowerBits) |
static boolean[] |
fromByte(byte b) |
static boolean |
isFalse(byte number,
int index)
Checks if the index-th bit of number is NOT set.
|
static boolean |
isTrue(byte number,
int index)
Checks if the index-th bit of number is set.
|
static byte |
setFalse(byte number,
int index)
Clears a bit, by setting it to 0.
|
static byte |
setTrue(byte number,
int index)
Sets a bit to 1.
|
static String |
toBinaryString(byte number) |
static byte |
toByte(boolean... values) |
public static byte setTrue(byte number, int index)
number
- the original byte valueindex
- the bit to setpublic static byte setFalse(byte number, int index)
number
- the original byte valueindex
- the bit to setpublic static boolean isTrue(byte number, int index)
number
- the byte valueindex
- the bit to checkpublic static boolean isFalse(byte number, int index)
number
- the byte valueindex
- the bit to checkpublic static byte toByte(boolean... values)
public static boolean[] fromByte(byte b)
public static String toBinaryString(byte number)
public static byte[] concatenate(byte[] a, byte[] b)
public static int combineToInt(short x, short y)
public static short extractShort(int value, boolean lowerBits)
public static long combineToLong(int x, int y)
public static int extractInt(long value, boolean lowerBits)
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.