Java tutorial
//package com.java2s; import java.io.ByteArrayInputStream; public class Main { protected static int extractByteValue(ByteArrayInputStream bais) { assert (null != bais); int temp = bais.read(); assert (-1 != temp); return temp & 0xFF; } }