Java Integer Convert To fromIntLong(byte[] value)

Here you can find the source of fromIntLong(byte[] value)

Description

from Int Long

License

Open Source License

Declaration

public static long fromIntLong(byte[] value) 

Method Source Code

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

public class Main {
    public static long fromIntLong(byte[] value) {
        return fromIntLong(value, 0);
    }/*from   w  w w .  ja v  a  2  s .  c om*/

    /**
     * (int)byte[] -> 4 byte -> int -> long
     * 
     * @param value
     * @param offset
     * @return
     */
    public static long fromIntLong(byte[] value, int offset) {
        long result = 0;
        result = result | (value[offset + 3] & 0xff);
        result = result | (((long) (value[offset + 2] & 0xff)) << 8);
        result = result | (((long) (value[offset + 1] & 0xff)) << 16);
        result = result | (((long) (value[offset + 0] & 0xff)) << 24);
        return result;
    }
}

Related

  1. fromInteger(Integer value)
  2. fromInteger(Integer value, String defaultValue)
  3. fromIntegers(Integer[] values, String defaultValue)
  4. fromIntegerString(String integerString)
  5. fromInternalForm(String internalForm)
  6. fromInts(int[] values)
  7. fromIntString(Object obj)
  8. fromIntWithPrefix(byte prefix, int v)
  9. IntegerTo(Integer i)