Changes

Jump to: navigation, search

Decorator

28 bytes added, 13:35, 1 March 2007
Example
class PushbackInputStream extends FilterInputStream {
public PushbackInputStream(InputStream in, int size) {
super(in);
if (size <= 0) {
throw new IllegalArgumentException("size <= 0");
}
this.buf = new byte[size]; this.pos = size;
}
public int read(){
ensureOpen();
if (pos < buf.length) {
return buf[pos++] & 0xff;
}
1
edit

Navigation menu