Java Integer Create toInt(byte[] readBuffer, int o)

Here you can find the source of toInt(byte[] readBuffer, int o)

Description

to Int

License

Open Source License

Declaration

public static int toInt(byte[] readBuffer, int o) 

Method Source Code

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

public class Main {
    public static int toInt(byte[] readBuffer, int o) {
        int ch1 = readBuffer[o++];
        int ch2 = readBuffer[o++];
        int ch3 = readBuffer[o++];
        int ch4 = readBuffer[o++];
        if ((ch1 | ch2 | ch3 | ch4) < 0)
            throw new IllegalStateException();
        return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0));
    }// w  w  w  . j a va  2  s . co m

    public static int toInt(byte[] readBuffer) {
        return toInt(readBuffer, 0);
    }
}

Related

  1. toInt(byte[] in)
  2. toInt(byte[] in)
  3. toInt(byte[] input)
  4. toInt(byte[] key)
  5. toInt(byte[] n)
  6. toInt(byte[] res)
  7. toInt(byte[] si)
  8. toInt(byte[] src)
  9. toInt(byte[] src)