Java examples for File Path IO:Byte Array
Returns 8 unsigned bits as an integer.
import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; import java.util.Iterator; import org.apache.log4j.Logger; public class Main{ /**/* ww w.j av a 2 s . c om*/ * Returns 8 unsigned bits as an integer. * * @param buf * @return */ final public static int getUnsignedByte(ByteBuffer buf) { return ((int) buf.get()) & 0xff; } }