com.hazelcast.nio
public final class Bits extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BOOLEAN_SIZE_IN_BYTES
Boolean size in bytes
|
static int |
BYTE_SIZE_IN_BYTES
Byte size in bytes
|
static int |
CACHE_LINE_LENGTH
Length of the data blocks used by the CPU cache sub-system in bytes.
|
static int |
CHAR_SIZE_IN_BYTES
Char size in bytes
|
static int |
DOUBLE_SIZE_IN_BYTES
Double size in bytes
|
static int |
FLOAT_SIZE_IN_BYTES
Float size in bytes
|
static int |
INT_SIZE_IN_BYTES
Integer size in bytes
|
static int |
LONG_SIZE_IN_BYTES
Long size in bytes
|
static int |
SHORT_SIZE_IN_BYTES
Short size in bytes
|
Modifier and Type | Method and Description |
---|---|
static byte |
clearBit(byte value,
int bit)
Clears n-th bit of the byte value
|
static int |
clearBit(int value,
int bit)
Clears n-th bit of the integer value
|
static int |
combineToInt(short x,
short y)
Combines two short integer values into an integer.
|
static long |
combineToLong(int x,
int y)
Combines two integer values into a long integer.
|
static int |
extractInt(long value,
boolean lowerBits) |
static short |
extractShort(int value,
boolean lowerBits) |
static byte |
invertBit(byte value,
int bit)
Inverts n-th bit of the byte value
|
static int |
invertBit(int value,
int bit)
Inverts n-th bit of the integer value
|
static boolean |
isBitSet(int value,
int bit)
Returns true if n-th bit of the value is set, false otherwise
|
static char |
readChar(byte[] buffer,
int pos,
boolean bigEndian) |
static char |
readCharB(byte[] buffer,
int pos) |
static char |
readCharL(byte[] buffer,
int pos) |
static int |
readInt(byte[] buffer,
int pos,
boolean bigEndian) |
static int |
readIntB(byte[] buffer,
int pos) |
static int |
readIntL(byte[] buffer,
int pos) |
static long |
readLong(byte[] buffer,
int pos,
boolean bigEndian) |
static long |
readLongB(byte[] buffer,
int pos) |
static long |
readLongL(byte[] buffer,
int pos) |
static short |
readShort(byte[] buffer,
int pos,
boolean bigEndian) |
static short |
readShortB(byte[] buffer,
int pos) |
static short |
readShortL(byte[] buffer,
int pos) |
static byte |
setBit(byte value,
int bit)
Sets n-th bit of the byte value
|
static int |
setBit(int value,
int bit)
Sets n-th bit of the integer value
|
static void |
writeChar(byte[] buffer,
int pos,
char v,
boolean bigEndian) |
static void |
writeCharB(byte[] buffer,
int pos,
char v) |
static void |
writeCharL(byte[] buffer,
int pos,
char v) |
static void |
writeInt(byte[] buffer,
int pos,
int v,
boolean bigEndian) |
static void |
writeIntB(byte[] buffer,
int pos,
int v) |
static void |
writeIntL(byte[] buffer,
int pos,
int v) |
static void |
writeLong(byte[] buffer,
int pos,
long v,
boolean bigEndian) |
static void |
writeLongB(byte[] buffer,
int pos,
long v) |
static void |
writeLongL(byte[] buffer,
int pos,
long v) |
static void |
writeShort(byte[] buffer,
int pos,
short v,
boolean bigEndian) |
static void |
writeShortB(byte[] buffer,
int pos,
short v) |
static void |
writeShortL(byte[] buffer,
int pos,
short v) |
public static final int BYTE_SIZE_IN_BYTES
public static final int BOOLEAN_SIZE_IN_BYTES
public static final int SHORT_SIZE_IN_BYTES
public static final int CHAR_SIZE_IN_BYTES
public static final int INT_SIZE_IN_BYTES
public static final int FLOAT_SIZE_IN_BYTES
public static final int LONG_SIZE_IN_BYTES
public static final int DOUBLE_SIZE_IN_BYTES
public static final int CACHE_LINE_LENGTH
public static char readChar(byte[] buffer, int pos, boolean bigEndian)
public static char readCharB(byte[] buffer, int pos)
public static char readCharL(byte[] buffer, int pos)
public static void writeChar(byte[] buffer, int pos, char v, boolean bigEndian)
public static void writeCharB(byte[] buffer, int pos, char v)
public static void writeCharL(byte[] buffer, int pos, char v)
public static short readShort(byte[] buffer, int pos, boolean bigEndian)
public static short readShortB(byte[] buffer, int pos)
public static short readShortL(byte[] buffer, int pos)
public static void writeShort(byte[] buffer, int pos, short v, boolean bigEndian)
public static void writeShortB(byte[] buffer, int pos, short v)
public static void writeShortL(byte[] buffer, int pos, short v)
public static int readInt(byte[] buffer, int pos, boolean bigEndian)
public static int readIntB(byte[] buffer, int pos)
public static int readIntL(byte[] buffer, int pos)
public static void writeInt(byte[] buffer, int pos, int v, boolean bigEndian)
public static void writeIntB(byte[] buffer, int pos, int v)
public static void writeIntL(byte[] buffer, int pos, int v)
public static long readLong(byte[] buffer, int pos, boolean bigEndian)
public static long readLongB(byte[] buffer, int pos)
public static long readLongL(byte[] buffer, int pos)
public static void writeLong(byte[] buffer, int pos, long v, boolean bigEndian)
public static void writeLongB(byte[] buffer, int pos, long v)
public static void writeLongL(byte[] buffer, int pos, long v)
public static byte setBit(byte value, int bit)
value
- byte valuebit
- n-th bitpublic static byte clearBit(byte value, int bit)
value
- byte valuebit
- n-th bitpublic static byte invertBit(byte value, int bit)
value
- byte valuebit
- n-th bitpublic static int setBit(int value, int bit)
value
- integer valuebit
- n-th bitpublic static int clearBit(int value, int bit)
value
- integer valuebit
- n-th bitpublic static int invertBit(int value, int bit)
value
- integer valuebit
- n-th bitpublic static boolean isBitSet(int value, int bit)
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.