Java Bits Convert to bitFieldToString(boolean[] bits)

Here you can find the source of bitFieldToString(boolean[] bits)

Description

Converts a bitfield into a string.

License

Open Source License

Parameter

Parameter Description

Return

String bitfield string representation.

Declaration

public static String bitFieldToString(boolean[] bits) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from   w w  w .j  a  v a  2 s .c  om*/
     * Converts a bitfield into a string.
     * @param boolean[] bits
     * @return String bitfield string representation.
     */
    public static String bitFieldToString(boolean[] bits) {
        String bitfield = "";
        for (int i = 0; i < bits.length; ++i) {
            if (bits[i]) {
                bitfield += "1";
            } else {
                bitfield += "0";
            }
        }
        return bitfield;

    }
}

Related

  1. BitArrayToString(Boolean[] asciiBinary)
  2. bitboardToString(final long l)
  3. bitboardToString(long bitboard)
  4. bitch(Throwable t)
  5. bitFieldToIndexArray(long bitfield)
  6. bitfieldToString(String[] statenames, int value)
  7. bitFlagByteLength(final int nbits)
  8. bitHistogram(int[] data)
  9. bitMap(final boolean v1, final boolean v2, final boolean v3, final boolean v4, final boolean v5, final boolean v6, final boolean v7, final boolean v8)