Java Binary Encode toBinary(byte b)

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

Description

to Binary

License

Apache License

Declaration

public static String toBinary(byte b) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String toBinary(byte b) {
        return String.format("%8s", Integer.toBinaryString(b & 0xFF)).replace(' ', '0');
    }/*from w  w  w. j  a v  a  2 s.c om*/
}

Related

  1. toBin(long value, int width)
  2. toBinArray(String hexStr)
  3. toBinary(byte b)
  4. toBinary(byte b)
  5. toBinary(byte b)
  6. toBinary(byte[] bytes)
  7. toBinary(final byte[] array, final int offset, final int length)
  8. toBinary(final byte[] bytes)
  9. toBinary(final double d)