Java Byte Array to Int bytesToInt2(byte[] arr, int offset)

Here you can find the source of bytesToInt2(byte[] arr, int offset)

Description

bytes To Int

License

Open Source License

Declaration

public static int bytesToInt2(byte[] arr, int offset) 

Method Source Code

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

public class Main {

    public static int bytesToInt2(byte[] arr, int offset) {
        int value;
        value = (int) (((arr[offset] & 0xFF) << 24) | ((arr[offset + 1] & 0xFF) << 16)
                | ((arr[offset + 2] & 0xFF) << 8) | (arr[offset + 3] & 0xFF));
        return value;
    }/*from  w  ww.  j a  va 2 s  .  c  o m*/
}

Related

  1. bytesToInt(final byte[] bytes)
  2. bytesToInt(final byte[] bytes)
  3. bytesToInt(final byte[] bytes, final int position, final int length, final int bitShiftStart, final int bitShitIncrement)
  4. bytesToInt(int off, byte... arr)
  5. bytesToInt16(byte highByte, byte lowByte)
  6. bytesToIntArr(byte[] arr, int offset, int[] num, int soff, int size)
  7. bytesToInteger(byte[] b)
  8. bytesToInteger(byte[] b, int off)
  9. bytesToInteger(byte[] bytes)