Java Byte Array to Int byteToInt(byte[] buf, int off)

Here you can find the source of byteToInt(byte[] buf, int off)

Description

byte To Int

License

Open Source License

Declaration

public static int byteToInt(byte[] buf, int off) 

Method Source Code

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

public class Main {
    public static int byteToInt(byte[] buf, int off) {
        int ch1 = buf[0 + off] & 0xFF;
        int ch2 = buf[1 + off] & 0xFF;
        int ch3 = buf[2 + off] & 0xFF;
        int ch4 = buf[3 + off] & 0xFF;
        return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0));
    }//w ww.j ava 2  s.  c  o  m
}

Related

  1. bytesToInts(byte[][] bytes)
  2. byteToInt(byte b[])
  3. byteToInt(byte[] b)
  4. byteToInt(byte[] b)
  5. byteToInt(byte[] bank)
  6. byteToInt(byte[] byteArray)
  7. byteToInt(byte[] bytes)
  8. byteToInt(byte[] i_Value)
  9. byteToInt(byte[] num)