Java Unsigned Number Create unsignedByteValue(final byte input)

Here you can find the source of unsignedByteValue(final byte input)

Description

Returns the value of an unsigned byte.

License

Open Source License

Parameter

Parameter Description
input the unsigned byte

Return

the integer value of the unsigned byte

Declaration

public static int unsignedByteValue(final byte input) 

Method Source Code

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

public class Main {
    /**//from ww w . ja  v  a 2 s.  c  om
     * Returns the value of an unsigned byte.
     *
     * @param input
     *            the unsigned byte
     * @return the integer value of the unsigned byte
     */
    public static int unsignedByteValue(final byte input) {
        final int mask = 0xFF;
        return input & mask;
    }
}

Related

  1. unsignedByteToInt(final byte b)
  2. unsignedByteToIntArray(byte[] bytes)
  3. unsignedByteToLong(final byte b)
  4. unsignedByteToString(int i)
  5. unsignedByteValue(byte[] data, int offset)
  6. unsignedChar(char c)
  7. unsignedChar(int val)
  8. unsignedCharToInt(byte[] b)
  9. unsignedCompare(long left, long right)