@Test
    public void testMarkAndResetAtEnd() throws Exception {
        InputStream in = new ByteArrayInputStream(sampleData.getBytes());
        LengthCheckInputStream rvis = new LengthCheckInputStream(in,
                sampleData.getBytes().length, INCLUDE_SKIPPED_BYTES);

        rvis.mark(100);
        StreamUtils.consumeInputStream(rvis);
        rvis.reset();
        StreamUtils.consumeInputStream(rvis);

        try {
            rvis.read();
        } catch (Exception e) {
            fail();
        }
        rvis.close();

    }
This test case initiates a marks the stream initially, drains the whole
stream. Resets the stream and drains again.
aws-java-sdk-core/src/test/java/com/amazonaws/util/LengthCheckInputStreamTest.java