public String read(final int length){
  if (length > this.length || pos + length > this.length) {
    throw new StringIndexOutOfBoundsException();
  }
  final String substring=source.substring(pos,pos + length);
  pos+=length;
  return substring;
}

public String read ( final int length ) { if ( length > this . length || pos + length > this . length ) { throw new StringIndexOutOfBoundsException ( ) ; } final String substring = source . substring ( pos , pos + length ) ; pos += length ; return substring ; }
attempts to read a substring of the specified length from the current position . the caller must ensure that the requested length is within the bounds i . e . the requested length from the current position should not exceed the length of the source string .
