public String charAsString(int nchars){
  return String.valueOf(buffer,ptr,nchars - 1);
}

public String charAsString ( int nchars ) { return String . valueOf ( buffer , ptr , nchars - 1 ) ; }
lookahead in the inputbuffer for n chars and return as a string . do not consume the input .
