public class Support_ASimpleInputStream extends InputStream
An implementation of {@code InputStream} that should serve as the
underlying stream for classes to be tested.
In particular this implementation allows to have IOExecptions thrown on demand.
For simplicity of use and understanding all fields are public.
if (throwExceptionOnNextUse) {
throw new IOException("Exception thrown for testing purpose.");
}
if (pos < len) {
int res = buf[pos];
pos++;
return res;
} else {
return -1;
}