Java Binary to Int binaryToInt(String binary, int intlength)

Here you can find the source of binaryToInt(String binary, int intlength)

Description

binary To Int

License

Open Source License

Declaration

public static String binaryToInt(String binary, int intlength) 

Method Source Code

//package com.java2s;

public class Main {
    public static String binaryToInt(String binary, int intlength) {
        String s = Integer.parseInt(binary, 2) + "";
        while ((s + "").length() < intlength) {
            s = "0" + s;
        }/*from ww w . j  a  v a2  s. c  o  m*/
        return s;
    }
}

Related

  1. bin2int(byte[] array, int offset)
  2. binaryToInt(String binaryValue, boolean signIncluded)
  3. binaryToLong(String bin)
  4. binToDec(String str)
  5. boolean2integer(boolean b)