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"));