Java Utililty Methods Byte Array Convert To

List of utility methods to do Byte Array Convert To

Description

The list of methods to do Byte Array Convert To are organized into topic(s).

Method

intBytes4ToInt(byte abyte0[], int offset)
Bytes To Int
return (0xff & abyte0[offset]) << 24 | (0xff & abyte0[offset + 1]) << 16 | (0xff & abyte0[offset + 2]) << 8
        | 0xff & abyte0[offset + 3];
longBytes8ToLong(byte abyte0[], int offset)
Bytes To Long
return (255L & (long) abyte0[offset]) << 56 | (255L & (long) abyte0[offset + 1]) << 48
        | (255L & (long) abyte0[offset + 2]) << 40 | (255L & (long) abyte0[offset + 3]) << 32
        | (255L & (long) abyte0[offset + 4]) << 24 | (255L & (long) abyte0[offset + 5]) << 16
        | (255L & (long) abyte0[offset + 6]) << 8 | (255L & (long) abyte0[offset + 7]);
voidbytes_to_sbuf(byte[] data, int offset, int length, StringBuffer buf)
bytetsbuf
bytes_to_sbuf(data, offset, length, false, buf);
longbytes_to_short(byte[] buf, int offset)
bytetshort
return bytes_to_long(buf, offset);
Stringbytes_to_str(byte[] data)
bytetstr
return bytes_to_str(data, 0, data.length, false);
StringbytesToAlphaNumeric(byte[] number)
Converts bytes representing the phone number alphanumeric value for digit and letters
StringBuilder alphaNumeric = new StringBuilder();
for (short n : number) {
    alphaNumeric.append(Character.toChars(n));
return alphaNumeric.toString();
StringbytesToAsciiMaybe(byte[] data)
bytes To Ascii Maybe
return bytesToAsciiMaybe(data, 0, data.length);
intbytesToBlocks(final long bytes, final int blockSize)
bytes To Blocks
if (bytes % blockSize == 0) {
    return (int) ((double) bytes / (double) blockSize);
} else {
    return (int) (((double) bytes / (double) blockSize) + 1.0);
booleanbytesToBool(byte[] data, int[] offset)
Return the boolean represented by the bytes in data staring at offset offset[0].
boolean result = true;
if (data[offset[0]] == 0) {
    result = false;
offset[0] += SIZE_BOOL;
return result;
Byte[]bytesToBoxingBytes(final byte[] bytes)
bytes To Boxing Bytes
final Byte[] bary = new Byte[bytes.length];
for (int i = 0; i < bytes.length; i++) {
    bary[i] = bytes[i];
return bary;