Here you can find the source of asUnsigned(final byte byteValue)
Parameter | Description |
---|---|
byteValue | byte value to be converted |
static final int asUnsigned(final byte byteValue)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w ww . j ava 2s . c om * Convert signed byte to unsigned int representation. * <p><b>PRE-conditions:</b> NONE * <br><b>POST-conditions:</b> 0 <= {@code result} <= 255 * <br><b>Side-effects:</b> NONE * <br><b>Created on:</b> <i>7:12:05 AM Mar 26, 2017</i> * * @param byteValue * byte value to be converted * @return converted int value */ static final int asUnsigned(final byte byteValue) { // 0xFF mask removes most significant bits, effectively represents signed byte as unsigned int return 0xFF & byteValue; } }