Android Byte Array to Int Convert readInt(byte[] buff, int pos)

Here you can find the source of readInt(byte[] buff, int pos)

Description

read Int

License

Open Source License

Declaration

public static int readInt(byte[] buff, int pos) 

Method Source Code

//package com.java2s;
/*//from w w w.ja  v a2s .co m
 * Copyright 2004-2008 H2 Group. Multiple-Licensed under the H2 License, Version 1.0, and under the Eclipse Public License, Version 1.0 (http://h2database.com/html/license.html). Initial Developer: H2 Group
 */

public class Main {
    public static int readInt(byte[] buff, int pos) {
        return (buff[pos++] << 24) + ((buff[pos++] & 0xff) << 16)
                + ((buff[pos++] & 0xff) << 8) + (buff[pos] & 0xff);
    }
}

Related

  1. toIntegerArray(byte[] input, int offset, int len)
  2. toIntegerArray(byte[] input, int offset, int len, int[] output, int outputOffset)
  3. toInt(byte[] bytes)
  4. toInteger(byte[] input)
  5. toInteger(byte[] input, int offset)
  6. getShort(byte[] data)
  7. getUnsignedSafe(byte[] buffer, int pos)
  8. toUInt16(byte[] bytes, int start)
  9. intToOctet(byte[] buf, int i)