Here you can find the source of unsignedByteToInt(final byte b)
Parameter | Description |
---|---|
b | <code>byte</code> to be converted to an int. |
int
which is the equivilant of the unsigned version of the byte
param.
public static int unsignedByteToInt(final byte b)
//package com.java2s; //License from project: BSD License public class Main { /**/*from ww w . j a v a 2s. co m*/ * Drop the sign bits in a byte for conversion to an int. * * @param b * <code>byte</code> to be converted to an int. * @return <code>int</code> which is the equivilant of the unsigned version * of the <code>byte</code> param. */ public static int unsignedByteToInt(final byte b) { return b & 0xFF; } }