Here you can find the source of intFromByteWithoutStupidJavaSignExtension(byte val)
final static int intFromByteWithoutStupidJavaSignExtension(byte val)
//package com.java2s; public class Main { final static int intFromByteWithoutStupidJavaSignExtension(byte val) { int ret = (0x7F) & val; if (val < 0) { ret += 128;//from w w w. j av a 2 s.c o m } return ret; } }