InputStreamBuffered extends InputStream { @Override public int read() throws IOException { return advance() ; } InputStreamBuffered(InputStream input);  InputStreamBuffered(InputStream input, int bufsize); @Override int read(); @Override void close(); final int advance(); static int DFT_BUFSIZE; }
@Test public void test_04() throws IOException { InputStream in = stream(1,2,3,4) ; InputStream in2 = new InputStreamBuffered(in, 1) ; check(in2, 1,2,3,4) ; assertEquals(-1, in.read()) ; }