code: 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);
      }
docs: Creates a new BoundedInputStream wrapping the same InputStream as this one, starting at the current position, with
  the given bound.
  
  NOTE: both this instance and the result of this method should not be both used at the same time to read from the
  InputStream. When this method returns, this instance's remaining count will be reduced by the given bound (that's
  since upon closing, the BoundedInputStream will auto-advance to its bound position).
  
  @param bound The bound of the sub-stream.
  @return A new instance of a BoundedInputStream.