Code example for CharArrayBuffer

Methods: append, length, substring

0
        } else { 
            String s = header.getValue();
            if (s == null) {
                throw new MalformedChallengeException("Header value is null");
            } 
            buffer = new CharArrayBuffer(s.length());
            buffer.append(s);
            pos = 0;
        } 
        while (pos < buffer.length() && HTTP.isWhitespace(buffer.charAt(pos))) {
            pos++;
        } 
        int beginIndex = pos;
        while (pos < buffer.length() && !HTTP.isWhitespace(buffer.charAt(pos))) {
            pos++;
        } 
        int endIndex = pos;
        String s = buffer.substring(beginIndex, endIndex);
        if (!s.equalsIgnoreCase(getSchemeName())) {
            throw new MalformedChallengeException("Invalid scheme identifier: " + s);
        } 
         
        parseChallenge(buffer, pos, buffer.length());
    } 
 
    protected abstract void parseChallenge( 
            CharArrayBuffer buffer, int pos, int len) throws MalformedChallengeException;