Java Integer Create toInt(byte[] key)

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

Description

to Int

License

BSD License

Declaration

public static int toInt(byte[] key) 

Method Source Code

//package com.java2s;
// BSD License (http://lemurproject.org/galago-license)

public class Main {
    public static int toInt(byte[] key) {
        assert isInt(key);
        return (((key[0] & 255) << 24) + ((key[1] & 255) << 16) + ((key[2] & 255) << 8) + (key[3] & 255));
    }//  w w  w . j ava  2s.  co  m

    public static boolean isInt(byte[] key) {
        return key != null && key.length == 4;
    }
}

Related

  1. toInt(byte[] data)
  2. toInt(byte[] data, int offset, int length)
  3. toInt(byte[] in)
  4. toInt(byte[] in)
  5. toInt(byte[] input)
  6. toInt(byte[] n)
  7. toInt(byte[] readBuffer, int o)
  8. toInt(byte[] res)
  9. toInt(byte[] si)