| java.lang.Object com.metaboss.util.ByteUtils
ByteUtils | public class ByteUtils (Code) | | Set of useful utilites to do with byte manipulations
|
Method Summary | |
public static String | bytesToText(byte[] pBytes) Converts given binary byte array to the character string
Each byte is represented by 2 successive characters in the string, which are the
the hex representation of the value of the byte. | public static String | bytesToText(byte[] pBytes, int pOffset, int pLength) Converts given binary byte array to the character string
Each byte is represented by 2 successive characters in the string, which are the
the hex representation of the value of the byte. | public static byte[] | readByteStreamFully(InputStream str) | public static byte[] | textToBytes(String pText) Converts given character string, which is assumed to be textual representation of the byte array
to the byte array. |
bytesToText | public static String bytesToText(byte[] pBytes)(Code) | | Converts given binary byte array to the character string
Each byte is represented by 2 successive characters in the string, which are the
the hex representation of the value of the byte. This string is double in size of
the underlying byte array, however it is safe to travel over many
character based protocols such as XML. Use textToBytes() for reverse conversion
Parameters: pBytes - byte array to convert String with hexadecimal representation of the bytes in array |
bytesToText | public static String bytesToText(byte[] pBytes, int pOffset, int pLength)(Code) | | Converts given binary byte array to the character string
Each byte is represented by 2 successive characters in the string, which are the
the hex representation of the value of the byte. This string is double in size of
the underlying byte array, however it is safe to travel over many
character based protocols such as XML. Use textToBytes() for reverse conversion
Parameters: pBytes - byte array to convert Parameters: pOffset - offset in the given byte array to start conversion from Parameters: pLength - number of bytes from offset to convert String with hexadecimal representation of the bytes in array |
readByteStreamFully | public static byte[] readByteStreamFully(InputStream str) throws IOException(Code) | | Fully reads given input stream and returns byte array with the result
|
textToBytes | public static byte[] textToBytes(String pText) throws IllegalArgumentException(Code) | | Converts given character string, which is assumed to be textual representation of the byte array
to the byte array. Each byte is represented by 2 successive characters in the string, which are the
the hex representation of the value of the byte. This string is double in size of
the underlying byte array, however it is safe to travel over many
character based protocols such as XML. Use bytesToText() for reverse conversion
Parameters: pText - string to convert byte[] with converted bytes exception: IllegalArgumentException - is thrown when supplied text is not convertable to bytes (i.e. text hasnot hexadecimal characters in it) |
|
|