Package org.apache.http.io

Examples of org.apache.http.io.CharArrayBuffer


            fail("IllegalArgumentException should habe been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            Header.format(new CharArrayBuffer(10), (Header) null);
            fail("IllegalArgumentException should habe been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
    }
View Full Code Here


    /**
     * @see java.lang.Object#toString()
     */
    public String toString() {
        CharArrayBuffer buffer = new CharArrayBuffer(16);
        buffer.append("HTTP/");
        buffer.append(Integer.toString(this.major));
        buffer.append('.');
        buffer.append(Integer.toString(this.minor));
        return buffer.toString();
    }
View Full Code Here

    public static final HttpVersion parse(final String s)
            throws ProtocolException {
        if (s == null) {
            throw new IllegalArgumentException("String may not be null");
        }
        CharArrayBuffer buffer = new CharArrayBuffer(s.length());
        buffer.append(s);
        return parse(buffer, 0, buffer.length());
    }
View Full Code Here

        buffer.append('.');
        buffer.append(Integer.toString(ver.getMinor()));
    }
    public static String format(final HttpVersion ver) {
        CharArrayBuffer buffer = new CharArrayBuffer(16);
        format(buffer, ver);
        return buffer.toString();
    }
View Full Code Here

            fail();
        } catch (HttpException e) { /* expected */ }
    }

    public void testParseInvalidInput() throws Exception {
        CharArrayBuffer buffer = new CharArrayBuffer(32);
        buffer.append("GET /stuff HTTP/1.1");
        try {
            RequestLine.parse(null, 0, 0);
            fail("IllegalArgumentException should have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
View Full Code Here

            fail("IllegalArgumentException should habe been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            RequestLine.format(new CharArrayBuffer(10), (RequestLine) null);
            fail("IllegalArgumentException should habe been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
    }
View Full Code Here

            fail();
        } catch (HttpException e) { /* expected */ }
    }

    public void testParseInvalidInput() throws Exception {
        CharArrayBuffer buffer = new CharArrayBuffer(32);
        buffer.append("HTTP/1.1 200 OK");
        try {
            StatusLine.parse(null, 0, 0);
            fail("IllegalArgumentException should have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
View Full Code Here

            fail("IllegalArgumentException should habe been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            StatusLine.format(new CharArrayBuffer(10), (StatusLine) null);
            fail("IllegalArgumentException should habe been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
    }
View Full Code Here

     * Return the host uri.
     *
     * @return The host uri.
     */
    public String toURI() {
      CharArrayBuffer buffer = new CharArrayBuffer(32);       
        buffer.append(this.scheme.getName());
        buffer.append("://");
        buffer.append(this.hostname);
        if (this.port != this.scheme.getDefaultPort()) {
            buffer.append(':');
            buffer.append(Integer.toString(this.port));
        }
        return buffer.toString();
    }
View Full Code Here

        }
        return buffer.toString();
    }

    public String toHostString() {
      CharArrayBuffer buffer = new CharArrayBuffer(32);       
        buffer.append(this.hostname);
        if (this.port != this.scheme.getDefaultPort()) {
            buffer.append(':');
            buffer.append(Integer.toString(this.port));
        }
        return buffer.toString();
    }
View Full Code Here

TOP

Related Classes of org.apache.http.io.CharArrayBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.