Package com.biglybt.core.util
Class ByteFormatter
java.lang.Object
com.biglybt.core.util.ByteFormatter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
byteArrayToInt
(byte[] array) Convert a Network Byte Order byte array into an intstatic byte[]
decodeString
(String str) static String
encodeString
(byte[] bytes) Note this has a truncation limit at 1024 chars....static String
encodeString
(byte[] bytes, int offset, int len) static String
encodeStringFully
(byte[] bytes) static byte[]
intToByteArray
(long v) static byte[]
longToByteArray
(long v) static String
nicePrint
(byte b) static String
nicePrint
(byte[] data) static String
nicePrint
(byte[] data, boolean tight) static String
nicePrint
(byte[] data, boolean tight, int max_length) static String
nicePrint
(byte[] data, int max) static String
nicePrint
(ByteBuffer data) static String
nicePrint2
(byte b)
-
Field Details
-
HEXDIGITS
static final char[] HEXDIGITS
-
-
Constructor Details
-
ByteFormatter
public ByteFormatter()
-
-
Method Details
-
nicePrint
-
nicePrint
-
nicePrint
-
nicePrint
-
nicePrint
-
nicePrint
-
nicePrint2
-
encodeString
Note this has a truncation limit at 1024 chars....- Parameters:
bytes
-- Returns:
-
encodeStringFully
-
encodeString
-
decodeString
-
byteArrayToInt
public static int byteArrayToInt(byte[] array) Convert a Network Byte Order byte array into an int- Parameters:
array
-- Returns:
- Since:
- 3.0.1.5
-
intToByteArray
public static byte[] intToByteArray(long v) -
longToByteArray
public static byte[] longToByteArray(long v)
-