Java Binary Encode toBinaryString(int[] input)

Here you can find the source of toBinaryString(int[] input)

Description

to Binary String

License

Open Source License

Declaration

public static String toBinaryString(int[] input) 

Method Source Code

//package com.java2s;

public class Main {
    public static String toBinaryString(int[] input) {
        String result = "";
        int i;/*from w  ww . java 2s .co m*/
        for (i = 0; i < input.length; i++) {
            int e = input[i];
            for (int ii = 0; ii < 32; ii++) {
                int b = (e >>> ii) & 1;
                result += b;
            }
            if (i != input.length - 1) {
                result += " ";
            }
        }
        return result;
    }
}

Related

  1. toBinaryString(int b, int bits)
  2. toBinaryString(int l, int L)
  3. toBinaryString(int number)
  4. toBinaryString(int number, int length)
  5. toBinaryString(int value)
  6. toBinaryString(long val)
  7. toBinaryString(long value, int bitLegnth)
  8. toBinaryStringAddress(long address)
  9. toBinaryText(StringBuffer buf)