Java Unsigned Byte Create toUnsignedByte(byte b)

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

Description

Converts the signed byte to its unsigned integer representation.

License

LGPL

Parameter

Parameter Description
b the byte to convert

Return

the corresponding unsigned integer in range 0 - 255

Declaration

public static int toUnsignedByte(byte b) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    /**//from  w  w  w .  ja  v a 2  s  .c o  m
     * Converts the signed byte to its unsigned integer representation.
     * @param b the byte to convert
     * @return the corresponding unsigned integer in range 0 - 255
     */
    public static int toUnsignedByte(byte b) {
        return (int) (b & 0xFF);
    }
}

Related

  1. toUnsignedByte(byte b)
  2. toUnsignedByte(byte b)
  3. toUnsignedByte(byte b)
  4. toUnsignedByte(byte value)
  5. toUnsignedByte(byte[] buf, int pos)
  6. toUnsignedByte(char[] bytes, boolean le)
  7. toUnsignedByte(int value)