Package org.mortbay.jetty.AbstractGenerator

Examples of org.mortbay.jetty.AbstractGenerator.OutputWriter


        HttpGenerator hb = new HttpGenerator(new SimpleBuffers(new Buffer[]{sb,bb}),endp, sb.capacity(), bb.capacity());

        hb.setResponse(200,"OK");
       
        Output output = new Output(hb,10000);
        OutputWriter writer = new OutputWriter(output);
        writer.setCharacterEncoding(StringUtil.__UTF8);
       
        char[] chars = new char[1024];
        for (int i=0;i<chars.length;i++)
            chars[i]=(char)('0'+(i%10));
        chars[0]='\u0553';
        writer.write(chars);
       
        hb.completeHeader(fields,true);
        hb.flush();
        String response = new String(endp.getOut().asArray(),StringUtil.__UTF8);
        assertTrue(response.startsWith("HTTP/1.1 200 OK\r\nContent-Length: 1025\r\n\r\n\u05531234567890"));
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.AbstractGenerator.OutputWriter

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.