Android Utililty Methods Byte Array to Char Convert

List of utility methods to do Byte Array to Char Convert

Description

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

Method

char[]bytetoChar(byte[] bytes)
byteto Char
Charset cs = Charset.forName(DEFAULT_CHARSET);
ByteBuffer bb = ByteBuffer.allocate(bytes.length);
bb.put(bytes);
bb.flip();
CharBuffer cb = cs.decode(bb);
return cb.array();
chargetChar(byte[] b, int index)
get Char
int s = 0;
if (b[index + 1] > 0)
    s += b[index + 1];
else
    s += 256 + b[index + 0];
s *= 256;
if (b[index + 0] > 0)
    s += b[index + 1];
...
chargetChar(byte[] bytes)
get Char
return (char) ((0xff & bytes[0]) | (0xff00 & (bytes[1] << 8)));