Java BigInteger Calculate getBytesWithoutSign(BigInteger arg)

Here you can find the source of getBytesWithoutSign(BigInteger arg)

Description

get Bytes Without Sign

License

Open Source License

Declaration

private static byte[] getBytesWithoutSign(BigInteger arg) 

Method Source Code


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

import java.math.BigInteger;

public class Main {
    private static byte[] getBytesWithoutSign(BigInteger arg) {
        byte[] sourceArray = arg.toByteArray();
        if (sourceArray[0] != 0) {
            return sourceArray;
        } else {//from   w  w  w .j a  v a  2s.c  o m
            byte[] withoutSign = new byte[sourceArray.length - 1];
            System.arraycopy(sourceArray, 1, withoutSign, 0, withoutSign.length);
            return withoutSign;
        }
    }
}

Related

  1. gcdExtended(BigInteger p, BigInteger q)
  2. getAddressText(BigInteger address)
  3. getByteArrayFromBigIntegerArray(Object value)
  4. getBytes(BigInteger bi, int minLen)
  5. getBytes(BigInteger big, int bitlen)
  6. getClearExpPipe(BigInteger M)
  7. getCreateLocalNextHopJobKey(Long vpnId, BigInteger dpnId, String prefix)
  8. getDateOf(BigInteger fileTime)
  9. getDateOf(final BigInteger fileTime)