Java Utililty Methods Byte to Char

List of utility methods to do Byte to Char

Description

The list of methods to do Byte to Char are organized into topic(s).

Method

charbyteToChar(byte aByte)
byte To Char
byte ref;
if (aByte >= 0 && aByte <= 9) {
    ref = (byte) '0';
} else if (aByte > 9 && aByte < 16) {
    ref = (byte) 'a' - 10;
} else {
    throw new IllegalArgumentException("The byte '" + aByte + "' cannot be converted to a char");
return (char) (aByte + ref);
charbyteToChar(byte b)
byte To Char
return (char) b;
charbyteToChar(byte b_)
Converts a byte to a char.
int intValue = (256 + b_) & 255;
return ((char) intValue);
charbyteToChar(byte c)
byte To Char
char result = '0';
if (c <= 9 && c >= 0) {
    result = (char) (c + '0');
if (c <= 15 && c >= 10) {
    result = (char) (c - 10 + 'A');
return result;
...
charbyteToChar(byte chr)
byte To Char
return BYTE2CHAR[getUnsignedByte(chr)];
char[]byteToChar(byte[] bytes)
byte To Char
char[] tempArray = new char[bytes.length];
for (int i = 0; i < bytes.length; i++) {
    tempArray[i] = (char) bytes[i];
return tempArray;
charbyteToChar(int b, char unprintable)
Translate the byte into an ASCII char if it is printable.
if ((b < 32) || (b > 126))
    return unprintable;
else
    return (char) b;
charByteToSafeChar(byte _bt)
Byte To Safe Char
final char chDefault = '.';
int bt = _bt & 0xff;
if (bt < 0x20)
    return chDefault;
if (bt < 0x7F)
    return (char) bt;
if (bt < 0xA0)
    return chDefault;
...
charcharAt(byte[] b, int s)
char At
if (s >= b.length) {
    throw new ArrayIndexOutOfBoundsException("Are you crazy?");
int c = b[s] & 0xff;
switch (c >> 4) {
case 0:
case 1:
case 2:
...