|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectice.util.ByteUtil
A utility class containing common byte related functionalities.
| Constructor Summary | |
ByteUtil()
|
|
| Method Summary | |
static byte[] |
padOrTruncate(byte[] bytes,
int length)
Pads or truncates the specified bytes to the specified
length. |
static String |
toHexadecimalString(byte[] bytes)
Converts the specified bytes to a hexadecimal
string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ByteUtil()
| Method Detail |
public static byte[] padOrTruncate(byte[] bytes,
int length)
throws IllegalArgumentException
Pads or truncates the specified bytes to the specified
length.
Padding or truncating the bytes is dependent on
bytes.length:
length padding is used;
length trancating is used;
length it remains unchanged.
bytes - the bytes that need to be either padded or truncated.length - the required length of the bytes being returned.
IllegalArgumentException - if the specified length is lesser than
0.public static String toHexadecimalString(byte[] bytes)
Converts the specified bytes to a hexadecimal
string.
bytes - the bytes to be converted.
bytes.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||