Code example for CharArrayWriter

Methods: append

0
                String method = request.getMethod();
                if (method == null) {
                    // No method means no request line 
                    buf.append('-');
                } else { 
                    buf.append(request.getMethod());
                    buf.append(' ');
                    buf.append(request.getRequestURI());
                    if (request.getQueryString() != null) {
                        buf.append('?');
                        buf.append(request.getQueryString());
                    } 
                    buf.append(' ');
                    buf.append(request.getProtocol());
                } 
            } else { 
                buf.append('-');
            } 
        } 
    }