Android Byte Array to Int Convert getUIntByByte(byte data)

Here you can find the source of getUIntByByte(byte data)

Description

new byte[] { 8, 4, 2, 1 } => 00000001 00000010 00000100 00001000

License

Open Source License

Parameter

Parameter Description
data a parameter

Declaration

public static int getUIntByByte(byte data) 

Method Source Code

//package com.java2s;

public class Main {
    /**//w w  w.j a v  a2s  .c  o  m
     * new byte[] { 8, 4, 2, 1 } => 00000001 00000010 00000100 00001000
     * 
     * @param data
     * @return
     */
    public static int getUIntByByte(byte data) {
        return data & 0xFF;
    }
}

Related

  1. getIntFromByteArray(final byte[] byteArr)
  2. getIntFromByteArray(final byte[] bytes)
  3. getIntLE2(byte[] b, int offset)
  4. getInts(int[] toInts, byte[] fromBytes)
  5. getInts(int[] toInts, byte[] fromBytes, int fromOffset)
  6. getUIntByByteArray(byte[] data)
  7. getUIntByByteArray(byte[] data, boolean isLH)
  8. toInt(byte[] src)
  9. toInt(byte[] src, int srcPos)