Android Byte Array to Int Convert getInt(byte b)

Here you can find the source of getInt(byte b)

Description

get Int

License

Open Source License

Declaration

public static int getInt(byte b) 

Method Source Code

//package com.java2s;

public class Main {
    public static int getInt(byte[] bytes) {
        return (0xff & bytes[0]) | (0xff00 & (bytes[1] << 8))
                | (0xff0000 & (bytes[2] << 16))
                | (0xff000000 & (bytes[3] << 24));
    }//  w w w .  j  a v a  2  s .co m

    public static int getInt(byte b) {
        return (0xff & b);
    }
}

Related

  1. bytesLE2ints(byte[] b)
  2. byteToUint(byte b)
  3. bytes2uint(byte[] bytes, int from, int to)
  4. bytesBE2int(byte[] b, int off)
  5. bytesBE2ints(byte[] b)
  6. getInt(byte[] bb, int index)
  7. getInt(byte[] bb, int index)
  8. getInt(byte[] bb, int index)
  9. getInt(byte[] buf, boolean bigEndian)