Java Unsigned Number Create unsign(byte b)

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

Description

Converts a signed byte to its unsigned int equivalent in the range 0-255.

License

Open Source License

Parameter

Parameter Description
b a byte value to be considered an unsigned integer

Return

the unsigned version of the byte

Declaration

public static int unsign(byte b) 

Method Source Code

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

public class Main {
    /**//from  w w w  .  j  av a  2  s.  c o m
     * Converts a signed byte to its unsigned int equivalent in the range 0-255.
     *
     * @param b a byte value to be considered an unsigned integer
     *
     * @return the unsigned version of the byte
     */
    public static int unsign(byte b) {
        return b & 0xff;
    }
}

Related

  1. unsign(byte b)
  2. unsign(byte b)
  3. unsign(byte by)
  4. unsign(byte i)