public BufferedHeader(final CharArrayBuffer buffer) throws ParseException {
  super();
  if (buffer == null) {
    throw new IllegalArgumentException("Char array buffer may not be null");
  }
  int colon=buffer.indexOf(':');
  if (colon == -1) {
    throw new ParseException("Invalid header: " + buffer.toString());
  }
  String s=buffer.substringTrimmed(0,colon);
  if (s.length() == 0) {
    throw new ParseException("Invalid header: " + buffer.toString());
  }
  this.buffer=buffer;
  this.name=s;
  this.valuePos=colon + 1;
}

public BufferedHeader ( final CharArrayBuffer buffer ) throws ParseException { super ( ) ; if ( buffer == null ) { throw new IllegalArgumentException ( "Char array buffer may not be null" ) ; } int colon = buffer . indexOf ( ':' ) ; if ( colon == - 1 ) { throw new ParseException ( "Invalid header: " + buffer . toString ( ) ) ; } String s = buffer . substringTrimmed ( 0 , colon ) ; if ( s . length ( ) == 0 ) { throw new ParseException ( "Invalid header: " + buffer . toString ( ) ) ; } this . buffer = buffer ; this . name = s ; this . valuePos = colon + 1 ; }
creates a new header from a buffer . the name of the header will be parsed immediately , the value only if it is accessed .
