public BoundedInputStream subStream ( int bound ) { Preconditions . checkArgument ( bound >= 0 && bound <= this . remaining , "bound must be a non-negative integer and less than or equal to the remaining length." ) ; this . remaining -= bound ; return new BoundedInputStream ( this . in , bound ) ; }
Creates a new BoundedInputStream wrapping the same InputStream as this one starting at the current position with the given bound .