Java Integer Create toInteger(byte[] input)

Here you can find the source of toInteger(byte[] input)

Description

to Integer

License

Apache License

Declaration

public static int toInteger(byte[] input) 

Method Source Code

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

public class Main {
    public static int toInteger(byte[] input) {
        return toInteger(input, 0);
    }//from ww w  . j a va  2s.  c  o  m

    private static int toInteger(byte[] input, int offset) {
        assert offset + 4 <= input.length : "Invalid length " + input.length;
        return ((input[offset++] & 0xff) << 24) | ((input[offset++] & 0xff) << 16) | ((input[offset++] & 0xff) << 8)
                | ((input[offset++] & 0xff));
    }
}

Related

  1. toInteger(byte[] b)
  2. toInteger(byte[] b)
  3. toInteger(byte[] bytes)
  4. toInteger(byte[] bytes)
  5. toInteger(byte[] bytes, int index)
  6. toInteger(E val)
  7. toInteger(final byte[] data)
  8. toInteger(final Double value)
  9. toInteger(final Object o)