public class ByteArrayUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static byte[] |
EMPTY_BYTE_ARRAY |
Constructor and Description |
---|
ByteArrayUtil() |
Modifier and Type | Method and Description |
---|---|
static 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[] |
bytes(java.lang.String v) |
static byte[] |
bytes(java.lang.String v,
java.nio.charset.Charset charset) |
static java.lang.String |
bytesToHex(byte[] bytes) |
static int |
compareUnsigned(byte[] o1,
byte[] o2) |
static int |
compareUnsigned(byte[] o1,
int off1,
byte[] o2,
int off2,
int len) |
static void |
copyBytes(byte[] src,
int srcPos,
byte[] dst,
int dstPos,
int length) |
static void |
copyBytes(byte[] src,
int srcPos,
java.nio.ByteBuffer dst,
int dstPos,
int length) |
static boolean |
getBoolean(byte[] b,
int off) |
static char |
getChar(byte[] b,
int off) |
static double |
getDouble(byte[] b,
int off) |
static float |
getFloat(byte[] b,
int off) |
static int |
getInt(byte[] b) |
static int |
getInt(byte[] b,
int off) |
static long |
getLong(byte[] b) |
static long |
getLong(byte[] b,
int off) |
static short |
getShort(byte[] b,
int off) |
static int |
getUnsignedShort(byte[] b,
int off) |
static byte[] |
hexToBytes(java.lang.String hex) |
static void |
putBoolean(byte[] b,
int off,
boolean val) |
static void |
putChar(byte[] b,
int off,
char val) |
static void |
putDouble(byte[] b,
int off,
double val) |
static void |
putFloat(byte[] b,
int off,
float val) |
static void |
putInt(byte[] b,
int off,
int val) |
static void |
putLong(byte[] b,
int off,
long val) |
static void |
putShort(byte[] b,
int off,
short val) |
static byte[] |
readWithLength(java.io.DataInput in) |
static byte[] |
readWithShortLength(java.io.DataInput in) |
static java.lang.String |
string(byte[] bytes) |
static java.lang.String |
string(byte[] buffer,
java.nio.charset.Charset charset) |
static void |
writeWithLength(byte[] bytes,
java.io.DataOutput out) |
static void |
writeWithShortLength(byte[] buffer,
java.io.DataOutput out) |
public static int compareUnsigned(byte[] o1, byte[] o2)
public static int compareUnsigned(byte[] o1, int off1, byte[] o2, int off2, int len)
public static byte[] bytes(byte b)
public static byte[] bytes(int v)
public static byte[] bytes(long v)
public static byte[] bytes(short v)
public static byte[] bytes(float v)
public static byte[] bytes(double v)
public static byte[] bytes(java.lang.String v)
public static byte[] bytes(java.lang.String v, java.nio.charset.Charset charset)
public static boolean getBoolean(byte[] b, int off)
public static char getChar(byte[] b, int off)
public static short getShort(byte[] b, int off)
public static int getUnsignedShort(byte[] b, int off)
public static int getInt(byte[] b, int off)
public static int getInt(byte[] b)
public static float getFloat(byte[] b, int off)
public static long getLong(byte[] b)
public static long getLong(byte[] b, int off)
public static double getDouble(byte[] b, int off)
public static void putBoolean(byte[] b, int off, boolean val)
public static void putChar(byte[] b, int off, char val)
public static void putShort(byte[] b, int off, short val)
public static void putInt(byte[] b, int off, int val)
public static void putFloat(byte[] b, int off, float val)
public static void putLong(byte[] b, int off, long val)
public static void putDouble(byte[] b, int off, double val)
public static java.lang.String bytesToHex(byte[] bytes)
public static byte[] hexToBytes(java.lang.String hex)
public static java.lang.String string(byte[] bytes) throws java.nio.charset.CharacterCodingException
java.nio.charset.CharacterCodingException
public static java.lang.String string(byte[] buffer, java.nio.charset.Charset charset) throws java.nio.charset.CharacterCodingException
java.nio.charset.CharacterCodingException
public static void writeWithLength(byte[] bytes, java.io.DataOutput out) throws java.io.IOException
java.io.IOException
public static void writeWithShortLength(byte[] buffer, java.io.DataOutput out) throws java.io.IOException
java.io.IOException
public static byte[] readWithLength(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static byte[] readWithShortLength(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static void copyBytes(byte[] src, int srcPos, byte[] dst, int dstPos, int length)
public static void copyBytes(byte[] src, int srcPos, java.nio.ByteBuffer dst, int dstPos, int length)
Copyright © 2009-2021 The Apache Software Foundation