@Test
    public void testSkipExcludedFailure() throws IOException {
        byte[] bytes = new byte[100];
        LengthCheckInputStream is = new LengthCheckInputStream(
                new ByteArrayInputStream(bytes), 100, EXCLUDE_SKIPPED_BYTES);
        assertTrue(10 == is.skip(10));
        try {
            StreamUtils.consumeInputStream(is);
            fail();
        } catch(AmazonClientException ex) {
            // expected
        }
        is.close();
    }
Actual number of bytes consumed is less than what's expected, when
skipped bytes are excluded.
aws-java-sdk-core/src/test/java/com/amazonaws/util/LengthCheckInputStreamTest.java