Java Bits Convert to bitStr(long value)

Here you can find the source of bitStr(long value)

Description

bit Str

License

Open Source License

Declaration

public static String bitStr(long value) 

Method Source Code

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

public class Main {
    public static String bitStr(long value) {
        StringBuffer buf = new StringBuffer();
        for (int i = 0; i < Long.SIZE; i++) {
            buf.append((value & 0x01) + "");
            value >>= 1;// ww w.ja  v a 2 s .c  o  m
        }
        buf.reverse();
        return buf.toString();
    }
}

Related

  1. bitsTo8Bytes(boolean[] bits)
  2. bitsToBase64(byte data)
  3. bitsToDouble(String bits, double min, double max, int splits)
  4. bitsToFloats(boolean[] b)
  5. bitsToTransform(int src, int target)
  6. bitString(boolean value)
  7. bitString(byte b)
  8. bitString2byte(String str)
  9. bitStringToInt(String bits, char one)