Here you can find the source of byteToUnsignedint(byte b)
public static int byteToUnsignedint(byte b)
//package com.java2s; //License from project: Open Source License public class Main { public static int byteToUnsignedint(byte b) { int i = b; if (i < 0) { i += 256;/*from www . j a v a 2 s. c o m*/ } return i; } }