Android Utililty Methods Byte to Bit Convert

List of utility methods to do Byte to Bit Convert

Description

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

Method

StringbyteToBit(byte[] bytes)
byte To Bit
StringBuilder sb = new StringBuilder();
for (int i = 0; i < Byte.SIZE * bytes.length; i++)
    sb.append((bytes[i / Byte.SIZE] << i % Byte.SIZE & 0x80) == 0 ? '0'
            : '1');
return sb.toString();
voidbyteToBit(byte[] bytes, StringBuilder sb)
byte To Bit
for (int i = 0; i < Byte.SIZE * bytes.length; i++)
    sb.append((bytes[i / Byte.SIZE] << i % Byte.SIZE & 0x80) == 0 ? '0'
            : '1');