Android Byte to Hex Convert getBinaryStrFromByte(byte b)

Here you can find the source of getBinaryStrFromByte(byte b)

Description

get Binary Str From Byte

License

Open Source License

Declaration

public static String getBinaryStrFromByte(byte b) 

Method Source Code

//package com.java2s;

public class Main {

    public static String getBinaryStrFromByte(byte b) {
        String result = "";
        byte a = b;
        for (int i = 0; i < 8; i++) {
            result = (a % 2) + result;//from  w  w w .  j a v  a  2s  .  c o  m
            a = (byte) (a >> 1);
        }
        return result;
    }
}

Related

  1. toHexString(byte abyte0)
  2. byteToHexString(byte b)
  3. getHexString(byte i)
  4. toHexString(byte b)
  5. toHexString(byte byt)
  6. getBinaryString(byte src)
  7. byteToHex(byte b)
  8. byteToHex(byte data)
  9. byteToHex(byte data)