public class ByteUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decodeBase64(byte[] source)
Decodes the encoded base64 byte array back as byte array.
|
static byte[] |
decodeHexString(char[] sourceChars)
Decodes the encoded hex string byte array back as byte array.
|
static byte[] |
decodeHexString(java.lang.String hexString)
Decodes the encoded hex string byte array back as byte array.
|
static void |
dumpAsHex(byte[] buffer,
java.io.PrintStream pStream)
Dumps the byte array as hex string to the
PrintStream. |
static void |
dumpAsHex(java.lang.String title,
byte[] buffer,
java.io.PrintStream pStream)
Dumps the byte array as hex string to the
PrintStream, with a title. |
static java.lang.String |
dumpAsHexToString(byte[] buffer)
The same as
dumpAsHex(byte[], PrintStream) but the output will be return as a String. |
static java.lang.String |
dumpAsHexToString(java.lang.String title,
byte[] buffer)
The same as
dumpAsHex(String, byte[], PrintStream) but the output will be return as a String. |
static byte[] |
encodeAsBase64(byte[] source)
Return the byte array encoded as a base64 string (chunked).
|
static byte[] |
encodeAsBase64(byte[] source,
boolean chunked)
Return the byte array encoded as a base64 string.
|
static java.lang.String |
encodeAsString(byte[] source)
Return the byte array encoded as a hex string.
|
static java.lang.String |
encodeToHex(byte[] buffer)
Encodes the byte array into a string as hexadecimal format.
|
static boolean |
equal(byte[] buffer1,
byte[] buffer2)
Test if the two byte arrays are equal.
|
static void |
main(java.lang.String[] args) |
public static boolean equal(byte[] buffer1,
byte[] buffer2)
buffer1 - buffer2 - public static void dumpAsHex(byte[] buffer,
java.io.PrintStream pStream)
PrintStream.buffer - pStream - public static void dumpAsHex(java.lang.String title,
byte[] buffer,
java.io.PrintStream pStream)
PrintStream, with a title.title - buffer - pStream - public static java.lang.String encodeToHex(byte[] buffer)
buffer - public static java.lang.String dumpAsHexToString(byte[] buffer)
dumpAsHex(byte[], PrintStream) but the output will be return as a String.buffer - public static java.lang.String dumpAsHexToString(java.lang.String title,
byte[] buffer)
dumpAsHex(String, byte[], PrintStream) but the output will be return as a String.title - buffer - public static java.lang.String encodeAsString(byte[] source)
source - public static byte[] decodeHexString(java.lang.String hexString)
throws org.apache.commons.codec.DecoderException
hexString - org.apache.commons.codec.DecoderExceptionpublic static byte[] decodeHexString(char[] sourceChars)
throws org.apache.commons.codec.DecoderException
sourceChars - org.apache.commons.codec.DecoderExceptionpublic static byte[] encodeAsBase64(byte[] source,
boolean chunked)
source - chunked - public static byte[] encodeAsBase64(byte[] source)
source - public static byte[] decodeBase64(byte[] source)
source - public static void main(java.lang.String[] args)
Copyright © 2004-2020 FEUP-LSTS and Neptus developers. All Rights Reserved.