Java Long to longToBinaryStringUnsigned(long value)

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

Description

long To Binary String Unsigned

License

MIT License

Declaration

public static String longToBinaryStringUnsigned(long value) 

Method Source Code

//package com.java2s;
/**/*from  w w w.  j av  a2 s.c  o  m*/
 * Copyright (c) 2014 Sa?l Pi?a <sauljabin@gmail.com>.
 * 
 * This file is part of GeneticAlgorithm.
 * 
 * GeneticAlgorithm is licensed under The MIT License.
 * For full copyright and license information please see the LICENSE file.
 */

public class Main {
    public static String longToBinaryStringUnsigned(long value) {
        return Long.toBinaryString(Math.abs(value));
    }

    public static String longToBinaryStringUnsigned(long value, int size) {
        return String.format("%" + size + "s",
                Long.toBinaryString(Math.abs(value))).replace(" ", "0");
    }
}

Related

  1. longToBcd(long num, int size)
  2. longToBcd(long src, int len, int flag)
  3. longToBigEndian(long value, byte[] in, int offset)
  4. longToBinary(long num)
  5. longtobinarystring(long wert, int bits)
  6. longToBucket(long key, int buckets)
  7. LongToBuf4(long val, byte[] buf, int offset)
  8. longToBuffer(long l, byte[] ioBuffer)
  9. longToCharArray(long seat, int length)