Java Integer From intFromByteArray(final byte[] buf, final int offset)

Here you can find the source of intFromByteArray(final byte[] buf, final int offset)

Description

int From Byte Array

License

Apache License

Declaration

public static final int intFromByteArray(final byte[] buf, final int offset) 

Method Source Code

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

public class Main {
    public static final int intFromByteArray(final byte[] buf, final int offset) {
        int v = 0;
        v |= ((((int) buf[offset + 0]) & 0xFF) << 24);
        v |= ((((int) buf[offset + 1]) & 0xFF) << 16);
        v |= ((((int) buf[offset + 2]) & 0xFF) << 8);
        v |= ((((int) buf[offset + 3]) & 0xFF) << 0);
        return v;
    }//w w  w .  j a  v  a  2s .  c  om
}

Related

  1. intFrom2Bytes(byte[] bytes, int index)
  2. intFrom4Bytes(byte[] bytes, int index)
  3. intFromBase64(String value)
  4. intFromBigEndainByteArray(byte[] buf, int offset, int len)
  5. intFromByte(byte byteValue)
  6. intFromByteArray(final byte[] byteArray)
  7. intFromByteRGB(byte[] reds, byte[] greens, byte[] blues)
  8. intFromBytes(byte[] b)
  9. intFrombytes(byte[] b, int pos)