Package org.gearman.util
Class ByteUtils
- java.lang.Object
-
- org.gearman.util.ByteUtils
-
public final class ByteUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
CHARSET_ASCII
static String
CHARSET_UTF_8
static byte[]
EMPTY
static byte
NULL
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
copy(byte[] orig)
null-safe byte[] copystatic String
fromAsciiBytes(byte[] bytes)
static int
fromBigEndian(byte[] b)
static String
fromBytes(byte[] bytes, String encoding)
static byte[]
fromHex(String hex)
static String
fromUTF8Bytes(byte[] bytes)
static byte
selectByte(int byteSignificance, int from)
static byte[]
toAsciiBytes(String string)
static byte[]
toBigEndian(int i)
static byte[]
toBytes(String string, String encoding)
static String
toHex(byte[] bytes)
static int
toInt(int byteSignificance, byte b)
static byte[]
toUTF8Bytes(String string)
-
-
-
Field Detail
-
NULL
public static final byte NULL
- See Also:
- Constant Field Values
-
EMPTY
public static final byte[] EMPTY
-
CHARSET_ASCII
public static final String CHARSET_ASCII
- See Also:
- Constant Field Values
-
CHARSET_UTF_8
public static final String CHARSET_UTF_8
- See Also:
- Constant Field Values
-
-
Method Detail
-
toAsciiBytes
public static byte[] toAsciiBytes(String string)
-
fromAsciiBytes
public static String fromAsciiBytes(byte[] bytes)
-
toUTF8Bytes
public static byte[] toUTF8Bytes(String string)
-
fromUTF8Bytes
public static String fromUTF8Bytes(byte[] bytes)
-
toHex
public static String toHex(byte[] bytes)
-
fromHex
public static byte[] fromHex(String hex)
-
toBigEndian
public static byte[] toBigEndian(int i)
-
fromBigEndian
public static int fromBigEndian(byte[] b)
-
selectByte
public static byte selectByte(int byteSignificance, int from)
-
toInt
public static int toInt(int byteSignificance, byte b)
-
copy
public static byte[] copy(byte[] orig)
null-safe byte[] copy
-
-