@PrivateApi 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 Charset |
ISO_8859_1
A reusable instance of the ISO Latin-1 charset
|
static int |
LONG_SIZE_IN_BYTES
Long size in bytes
|
static int |
NULL_ARRAY_LENGTH
for null arrays, this value writen to stream to represent null array size.
|
static int |
SHORT_SIZE_IN_BYTES
Short size in bytes
|
static Charset |
UTF_8
A reusable instance of the UTF-8 charset
|
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 useBigEndian) |
static char |
readCharB(byte[] buffer,
int pos) |
static char |
readCharL(byte[] buffer,
int pos) |
static int |
readInt(byte[] buffer,
int pos,
boolean useBigEndian) |
static int |
readIntB(byte[] buffer,
int pos) |
static int |
readIntL(byte[] buffer,
int pos) |
static int |
readIntL(ByteBuffer buffer) |
static long |
readLong(byte[] buffer,
int pos,
boolean useBigEndian) |
static long |
readLongB(byte[] buffer,
int pos) |
static long |
readLongL(byte[] buffer,
int pos) |
static short |
readShort(byte[] buffer,
int pos,
boolean useBigEndian) |
static short |
readShortB(byte[] buffer,
int pos) |
static short |
readShortL(byte[] buffer,
int pos) |
static int |
readUtf8Char(byte[] buffer,
int pos,
char[] dst,
int dstPos) |
static char |
readUtf8Char(DataInput in,
byte firstByte) |
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 useBigEndian) |
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 useBigEndian) |
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 useBigEndian) |
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 useBigEndian) |
static void |
writeShortB(byte[] buffer,
int pos,
short v) |
static void |
writeShortL(byte[] buffer,
int pos,
short v) |
static int |
writeUtf8Char(byte[] buffer,
int pos,
int c) |
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 NULL_ARRAY_LENGTH
public static final int CACHE_LINE_LENGTH
public static final Charset UTF_8
public static final Charset ISO_8859_1
public static char readChar(byte[] buffer, int pos, boolean useBigEndian)
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 useBigEndian)
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 useBigEndian)
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 useBigEndian)
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 useBigEndian)
public static int readIntB(byte[] buffer, int pos)
public static int readIntL(byte[] buffer, int pos)
public static int readIntL(ByteBuffer buffer)
public static void writeInt(byte[] buffer, int pos, int v, boolean useBigEndian)
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 useBigEndian)
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 useBigEndian)
public static void writeLongB(byte[] buffer, int pos, long v)
public static void writeLongL(byte[] buffer, int pos, long v)
public static int writeUtf8Char(byte[] buffer, int pos, int c)
public static int readUtf8Char(byte[] buffer, int pos, char[] dst, int dstPos) throws IOException
IOException
public static char readUtf8Char(DataInput in, byte firstByte) throws IOException
IOException
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 © 2018 Hazelcast, Inc.. All rights reserved.