private void testPositive(final int readLimit) throws IOException {
        byte[] bytes = new byte[100];
        for (int i=0; i < bytes.length; i++)
            bytes[i] = (byte)i;
        // buffer of 10 bytes
        BufferedInputStream bis =
            new BufferedInputStream(new ByteArrayInputStream(bytes), 10);
        // skip 10 bytes
        bis.skip(10);
        bis.mark(readLimit);   // buffer size would increase up to readLimit
        // read 30 bytes in total, with internal buffer increased to 20
        bis.read(new byte[20]);
        bis.reset();
        assert(bis.read() == 10);
    }
This test demonstrates why we should call mark(Integer.MAX_VALUE) instead of
mark(-1).
aws-java-sdk-core/src/test/java/com/amazonaws/internal/BufferedInputStreamResetTest.java