Package org.apache.cassandra.utils
Class ByteArrayUtil
java.lang.Object
org.apache.cassandra.utils.ByteArrayUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]bytes(byte b) static byte[]bytes(double v) static byte[]bytes(float v) static byte[]bytes(int v) static byte[]bytes(long v) static byte[]bytes(short v) static byte[]static byte[]static StringbytesToHex(byte[] bytes) static intcompareUnsigned(byte[] o1, byte[] o2) static intcompareUnsigned(byte[] o1, int off1, byte[] o2, int off2, int len) static voidcopyBytes(byte[] src, int srcPos, byte[] dst, int dstPos, int length) static voidcopyBytes(byte[] src, int srcPos, ByteBuffer dst, int dstPos, int length) 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) static intgetInt(byte[] b, int off) static longgetLong(byte[] b) static longgetLong(byte[] b, int off) static shortgetShort(byte[] b, int off) static intgetUnsignedShort(byte[] b, int off) static byte[]hexToBytes(String hex) 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 byte[]static byte[]static byte[]static intserializedSizeWithVIntLength(byte[] bytes) static Stringstring(byte[] bytes) static Stringstatic voidwriteWithLength(byte[] bytes, DataOutput out) static voidwriteWithShortLength(byte[] buffer, DataOutput out) static voidwriteWithVIntLength(byte[] bytes, DataOutputPlus out)
-
Field Details
-
EMPTY_BYTE_ARRAY
public static final byte[] EMPTY_BYTE_ARRAY
-
-
Constructor Details
-
ByteArrayUtil
public ByteArrayUtil()
-
-
Method Details
-
compareUnsigned
public static int compareUnsigned(byte[] o1, byte[] o2) -
compareUnsigned
public static int compareUnsigned(byte[] o1, int off1, byte[] o2, int off2, int len) -
bytes
public static byte[] bytes(byte b) -
bytes
public static byte[] bytes(int v) -
bytes
public static byte[] bytes(long v) -
bytes
public static byte[] bytes(short v) -
bytes
public static byte[] bytes(float v) -
bytes
public static byte[] bytes(double v) -
bytes
-
bytes
-
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) -
getUnsignedShort
public static int getUnsignedShort(byte[] b, int off) -
getInt
public static int getInt(byte[] b, int off) -
getInt
public static int getInt(byte[] b) -
getFloat
public static float getFloat(byte[] b, int off) -
getLong
public static long getLong(byte[] b) -
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) -
bytesToHex
-
hexToBytes
-
string
- Throws:
CharacterCodingException
-
string
- Throws:
CharacterCodingException
-
writeWithLength
- Throws:
IOException
-
writeWithShortLength
- Throws:
IOException
-
writeWithVIntLength
- Throws:
IOException
-
serializedSizeWithVIntLength
public static int serializedSizeWithVIntLength(byte[] bytes) -
readWithLength
- Throws:
IOException
-
readWithShortLength
- Throws:
IOException
-
readWithVIntLength
- Throws:
IOException
-
copyBytes
public static void copyBytes(byte[] src, int srcPos, byte[] dst, int dstPos, int length) -
copyBytes
-