Java Utililty Methods Long Number From

List of utility methods to do Long Number From

Description

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

Method

doubletoLongitude(long fsuipcLongitude)
To convert to Degrees: If your compiler supports long long (64-bit) integers then use such a variable to simply copy this 64-bit value into a double floating point variable and multiply by 360.0/(65536.0 * 65536.0 * 65536.0 * 65536.0).
return (fsuipcLongitude * (360.0 / (65536.0 * 65536.0 * 65536.0 * 65536.0)));
doubletoLongitude(String latLng)
Method to parse the longitude of a location in the format (<latitude>,<longitude>)
String longitude = latLng.substring(latLng.indexOf(",") + 1, latLng.indexOf(")"));
return Double.parseDouble(longitude);
voidtoLongLE(byte target[], int offset, int numBytes, long value)
Little endian, i.e.
if (numBytes <= 0 || numBytes > 8)
    throw new IllegalArgumentException("Invalid number of bytes");
if (value < 0)
    throw new IllegalArgumentException("Negative value not allowed");
int limit = offset + numBytes;
for (int i = offset; i < limit; i++) {
    target[i] = (byte) value;
    value >>= 8;
...
Long[]toLongList(String valus)
to Long List
Long[] longList = null;
try {
    String[] strList = valus.replace(" ", "").split(",");
    longList = new Long[strList.length];
    for (int i = 0; i < strList.length; i++) {
        longList[i] = Long.parseLong(strList[i]);
} catch (Exception e) {
...
long[][]toLongMatrix(Number[][] matrix)
Turns the Number matrix into one consisting of primitive longs.
long[][] result;
int i;
int n;
result = new long[matrix.length][];
for (i = 0; i < matrix.length; i++) {
    result[i] = new long[matrix[i].length];
    for (n = 0; n < matrix[i].length; n++)
        result[i][n] = matrix[i][n].longValue();
...
voidtoLongMin(double[] in, long[] out)
to Long Min
for (int i = 0; i < in.length; i++) {
    long newcoord = (long) Math.floor(in[i]);
    if (newcoord < out[i])
        out[i] = newcoord;
LongtoLongObject(Object obj)
Converts an Object to a Long.
if (obj == null) {
    return null;
if (obj instanceof Long) {
    return (Long) obj;
if (obj instanceof Number) {
    return new Long(((Number) obj).longValue());
...
long[]toLongs(byte[] bytes)
to Longs
int size = toInt(bytes, 0);
long[] result = new long[size];
int offset = SIZEOF_INT;
for (int i = 0; i < size; i++) {
    result[i] = toLong(bytes, offset);
    offset += SIZEOF_LONG;
return result;
...
long[]toLongs(byte[] readBuffer, int o, int l)
to Longs
long[] v = new long[l / 8];
for (int i = 0; i < v.length; i++)
    v[i] = toLong(readBuffer, o + i * 8);
return v;
long[]toLongs(byte[] value, int offset, int num)
to Longs
long[] values = new long[num];
int idx = 0;
for (int i = offset; i < offset + (num * 8); i += 8) {
    values[idx++] = getLong(value, i);
return values;