Java tutorial
//package com.java2s; public class Main { /** * Converts a byte to an int, preserving the sign. * * For example, FF will be converted to 255 and not -1. * * @param bite the bite * @return the int from byte */ public static int getIntFromByte(final byte bite) { return Integer.valueOf(bite & 0xFF); } }