Java Integer Create toInt(byte[] data)

Here you can find the source of toInt(byte[] data)

Description

to Int

License

Apache License

Declaration

public static int toInt(byte[] data) 

Method Source Code

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

public class Main {
    public static int toInt(byte[] data) {
        if (data.length != 4)
            return 0;
        return (int) data[0] << 24 | (int) data[1] << 16 | (int) data[2] << 8 | (int) data[3];
    }/*from   w  ww.  jav a  2s .  com*/
}

Related

  1. toInt(byte[] bytes, int index)
  2. toInt(byte[] bytes, int offset)
  3. toInt(byte[] bytes, int offset)
  4. toInt(byte[] bytes, int offset)
  5. toInt(byte[] bytes, int offset)
  6. toInt(byte[] data)
  7. toInt(byte[] data)
  8. toInt(byte[] data, int offset, int length)
  9. toInt(byte[] in)