Java Integer From intFromBytes(byte[] bytes)

Here you can find the source of intFromBytes(byte[] bytes)

Description

int From Bytes

License

Apache License

Declaration

public static int intFromBytes(byte[] bytes) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int intFromBytes(byte[] bytes) {
        return intFromBytes(bytes[0], bytes[1], bytes[2], bytes[3]);
    }//from w w  w .j a  v  a 2s  . c  o m

    public static int intFromBytes(byte a, byte b, byte c, byte d) {
        return a << 24 | (b & 0xFF) << 16 | (c & 0xFF) << 8 | (d & 0xFF);
    }
}

Related

  1. intFromBytes(byte[] b)
  2. intFrombytes(byte[] b, int pos)
  3. intFromBytes(byte[] buffer)
  4. intFromBytes(byte[] buffer, int offset)
  5. intFromBytes(byte[] bytes)
  6. intFromBytes(byte[] bytes, int offset)
  7. intFromByteWithoutStupidJavaSignExtension(byte val)
  8. intFromHex(String hex, boolean signed)
  9. intFromJSON(String[] json, int pos)