List of utility methods to do Byte to Char
char | byteToChar(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); |
char | byteToChar(byte b) byte To Char return (char) b; |
char | byteToChar(byte b_) Converts a byte to a char. int intValue = (256 + b_) & 255; return ((char) intValue); |
char | byteToChar(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; ... |
char | byteToChar(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; |
char | byteToChar(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; |
char | ByteToSafeChar(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; ... |
char | charAt(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: ... |