Java Integer to Binary intToBinary(int i, int byteLength)

Here you can find the source of intToBinary(int i, int byteLength)

Description

int To Binary

License

Open Source License

Declaration

public static String intToBinary(int i, int byteLength) 

Method Source Code

//package com.java2s;

public class Main {
    public static String intToBinary(int i, int byteLength) {
        String binString = Integer.toBinaryString(i);
        while (binString.length() < byteLength * 8) {
            binString = "0" + binString;
        }/*from   ww  w . java  2 s .  com*/
        return binString;
    }
}

Related

  1. integerToBinaryString(int value)
  2. integerToBinaryString(int value, int numberOfBits)
  3. integerToBinString(final int aValue, final int aFieldWidth)
  4. intToBinary(int binary, int digits)
  5. intToBinary(int i)
  6. intToBinary(long value, int bits)
  7. intToBinString(int val, int width)
  8. itob(int i, int j)
  9. ItoB(int x)