@Test
    public void requireThatBasicsWork() throws IOException {
        ByteLimitedInputStream stream = create("abcdefghijklmnopqr".getBytes(StandardCharsets.US_ASCII), 9);

        assertEquals(9, stream.available());
        assertEquals(97, stream.read());
        assertEquals(8, stream.available());
        assertEquals(98, stream.read());
        assertEquals(7, stream.available());
        assertEquals(99, stream.read());
        assertEquals(6, stream.available());
        assertEquals(100, stream.read());
        assertEquals(5, stream.available());
        assertEquals(101, stream.read());
        assertEquals(4, stream.available());
        assertEquals(102, stream.read());
        assertEquals(3, stream.available());
        assertEquals(103, stream.read());
        assertEquals(2, stream.available());
        assertEquals(104, stream.read());
        assertEquals(1, stream.available());
        assertEquals(105, stream.read());
        assertEquals(0, stream.available());
        assertEquals(-1, stream.read());
        assertEquals(0, stream.available());
        assertEquals(-1, stream.read());
        assertEquals(0, stream.available());
        assertEquals(-1, stream.read());
        assertEquals(0, stream.available());
        assertEquals(-1, stream.read());
        assertEquals(0, stream.available());
        assertEquals(-1, stream.read());
        assertEquals(0, stream.available());
    }
@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
@since 5.1.23
vespaclient-container-plugin/src/test/java/com/yahoo/vespa/http/server/util/ByteLimitedInputStreamTestCase.java