public static InputStream getBoundedStream ( final InputStream stream , final int from , final int to ) throws IOException { final long skipped = stream . skip ( from ) ; LOGGER . debug ( "Skipped {} bytes" , skipped ) ; return new BoundedInputStream ( stream , ( long ) to - from ) ; }
Get a bounded inputstream .