Android Byte Array to Int Convert toInt(byte[] src, int srcPos)

Here you can find the source of toInt(byte[] src, int srcPos)

Description

to Int

Declaration

public static int toInt(byte[] src, int srcPos) 

Method Source Code

//package com.java2s;

public class Main {

    public static int toInt(byte[] src, int srcPos) {
        int dword = 0;
        for (int i = 0; i < 4; i++) {
            dword = (dword << 8) + (src[i + srcPos] & 0xFF);
        }/*ww  w  .ja  va2  s. c  om*/
        return dword;
    }

    public static int toInt(byte[] src) {
        return toInt(src, 0);
    }
}

Related

  1. getInts(int[] toInts, byte[] fromBytes, int fromOffset)
  2. getUIntByByte(byte data)
  3. getUIntByByteArray(byte[] data)
  4. getUIntByByteArray(byte[] data, boolean isLH)
  5. toInt(byte[] src)
  6. toIntFromTwoBytes(byte[] b, int pos)
  7. toInteger(byte[] b, int pos)
  8. toInteger(byte[] b, int pos, int width)
  9. toInts(byte... bytes)