Java Byte to Unsigned Int byteToUInt(byte b)

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

Description

Returns the unsigned value of a byte

License

Open Source License

Parameter

Parameter Description
the byte witch u want to convert

Declaration

public static int byteToUInt(byte b) 

Method Source Code

//package com.java2s;
/*//from w  w  w .  j  a v a  2  s.co  m
 * This file is part of l2jserver2 <l2jserver2.com>.
 *
 * l2jserver2 is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * l2jserver2 is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with l2jserver2.  If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    /**
     * Returns the unsigned value of a byte
     * 
     * @param the
     *            byte witch u want to convert
     */
    public static int byteToUInt(byte b) {
        return b & 0xFF;
    }
}

Related

  1. asUnsignedInt(byte signedValue)
  2. asUnsignedLong(byte signedValue)
  3. asUnsignedShort(byte signedValue)
  4. asUnsignedShort(short s)
  5. byteToUByte(byte value)
  6. byteToul(byte b)
  7. byteToUnInt(Byte sByte)
  8. byteToUnsigned(byte b)
  9. byteToUnsigned(byte b)