43 import java.nio.charset.*;
84 private static String
CRLF =
"\r\n";
85 private static Charset
ascii = Charset.forName(
"US-ASCII");
87 private ByteBuffer
hbb =
null;
90 CharBuffer cb = CharBuffer.allocate(1024);
94 cb.put(
"Server: niossl/0.1").put(
CRLF);
96 cb.put(
"Content-length: ")
100 }
catch (BufferOverflowException x) {
101 assert(cb.capacity() < (1 << 16));
102 cb = CharBuffer.allocate(cb.capacity() * 2);
107 return ascii.encode(cb);
118 throw new IllegalStateException();
120 if (
hbb.hasRemaining()) {
121 if (cio.write(
hbb) <= 0)
130 if (!cio.dataFlush())