Here you can find the source of unsignedCharToInt(byte[] b)
public static final int unsignedCharToInt(byte[] b)
//package com.java2s; //License from project: Open Source License public class Main { public static final int unsignedCharToInt(byte[] b) { if (b.length != 1) { throw new IllegalArgumentException(); }//from ww w. j a va 2s .co m int i = 0; i |= b[0] & 0xff; return i; } }