Java Unsigned Int Create toUnsignedInt(byte b)

Here you can find the source of toUnsignedInt(byte b)

Description

Convert a signed byte to an unsigned int (unsigned in the sense that only values between 0 and 255 are allowed).

License

Open Source License

Parameter

Parameter Description
b Byte to convert.

Return

Unsigned int representation of the signed byte.

Declaration

public static int toUnsignedInt(byte b) 

Method Source Code

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

public class Main {
    /**/*  w ww .java2  s .  c  o  m*/
     * Convert a signed byte to an unsigned int (unsigned in the sense that only values between 0 and 255 are allowed).
     *
     * @param b     Byte to convert.
     * @return      Unsigned int representation of the signed byte.
     */
    public static int toUnsignedInt(byte b) {
        return b & 0xFF;
    }
}

Related

  1. toUnsignedInt(byte b)
  2. toUnsignedInt(byte b1, byte b2, byte b3, byte b4)
  3. toUnsignedInt(byte value)
  4. toUnsignedInt(byte x)