Android Byte Array to Int Convert getIntFromByte(final byte bite)

Here you can find the source of getIntFromByte(final byte bite)

Description

Converts a byte to an int, preserving the sign.

Parameter

Parameter Description
bite the bite

Return

the int from byte

Declaration

public static int getIntFromByte(final byte bite) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*  w w w. ja  v  a  2  s  . c o  m*/
     * Converts a byte to an int, preserving the sign.
     *
     * For example, FF will be converted to 255 and not -1.
     *
     * @param bite the bite
     * @return the int from byte
     */
    public static int getIntFromByte(final byte bite) {
        return Integer.valueOf(bite & 0xFF);
    }
}

Related

  1. getInt(int offset, byte[] fromBytes)
  2. getInt2(byte[] b, int offset)
  3. getInt3(byte[] b, int offset)
  4. getIntFrom2ByteArray(final byte[] input)
  5. getIntFromByte(final byte bite)
  6. getIntFromByteArray(final byte[] byteArr)
  7. getIntFromByteArray(final byte[] bytes)
  8. getIntLE2(byte[] b, int offset)
  9. getInts(int[] toInts, byte[] fromBytes)