Java Utililty Methods Long Number Create

List of utility methods to do Long Number Create

Description

The list of methods to do Long Number Create are organized into topic(s).

Method

longtoLong(byte[] readBuffer, int o)
to Long
return (((long) readBuffer[0] << 56) + ((long) (readBuffer[1] & 255) << 48)
        + ((long) (readBuffer[2] & 255) << 40) + ((long) (readBuffer[3] & 255) << 32)
        + ((long) (readBuffer[4] & 255) << 24) + ((readBuffer[5] & 255) << 16)
        + ((readBuffer[6] & 255) << 8) + ((readBuffer[7] & 255) << 0));
longtoLong(byte[] si, boolean isReverseOrder)
Convert a byte[] to the corresponding long value.
long l = 0L;
if (isReverseOrder) {
    si = reverseOrder(si, 8);
int nb = si.length - 1;
for (byte i = 0; i <= nb; i++) {
    long j;
    if (si[i] < 0) {
...
long[]toLong(byte[] src)
Convert an array of byte 's into an array of long '.
int number = src.length;
long[] dst = new long[number];
for (int j = 0; j < number; ++j) {
    dst[j] = (long) src[j];
return dst;
longtoLong(byte[] src, int srcPos)
to Long
long qword = 0;
for (int i = 0; i < 8; i++) {
    qword = (qword << 8) + (src[i + srcPos] & 0xFF);
return qword;
LongtoLong(byte[] v)
to Long
if (v == null) {
    return null;
long firstPart = (((v[0] & 0xFF) << 24) + ((v[1] & 0xFF) << 16) + ((v[2] & 0xFF) << 8) + (v[3] & 0xFF))
        * 72057594037927936l;
int secondPart = ((v[0] & 0xFF) << 24) + ((v[1] & 0xFF) << 16) + ((v[2] & 0xFF) << 8) + (v[3] & 0xFF);
return firstPart + secondPart;
longtoLong(byte[] value)
to Long
return toLong(value, 0);
longtoLong(byte[] value)
Converte um texto representado por um arranjo de bytes em um inteiro.
int limit = value.length - 1;
byte signal = value[0] == NEGATIVE ? FALSE : TRUE;
byte hasSignal = value[0] == NEGATIVE || value[0] == POSITIVE ? TRUE : FALSE;
int start = hasSignal == TRUE ? 1 : 0;
long result = 0;
int mult = 1;
for (int i = limit; i >= start; i--) {
    int tmp = value[i] - ZERO;
...
longtoLong(byte[] vint)
to Long
if (vint.length == 0)
    throw new ArrayIndexOutOfBoundsException("size of the vint array is zero");
byte firstByte = vint[0];
if (firstByte == 0) {
    return 0;
int numOfBytes = getNumberOfBytesInVint(firstByte);
firstByte = (byte) ((firstByte & 0xFF) ^ (sig[numOfBytes] & 0xFF));
...
longtoLong(double val)
to Long
return (long) Math.floor(val + DOUBLE_EPS);
voidtoLong(double[] in, long[] out)
to Long
for (int i = 0; i < in.length; i++) {
    out[i] = (long) Math.round(in[i]);