|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jini.jeri.internal.http.MessageWriter
class MessageWriter
Class for writing HTTP messages. Each instance writes a single HTTP message.
Nested Class Summary | |
---|---|
private class |
MessageWriter.ChunkedOutputStream
Output stream for writing chunked transfer-coded content. |
Field Summary | |
---|---|
private static int |
CHUNK_SIZE
|
private static int |
CONTENT
|
private OutputStream |
cout
|
private static int |
DONE
|
private Header |
header
|
private static int |
HEADER
|
private OutputStream |
out
|
private static int |
START
|
private int |
state
|
Constructor Summary | |
---|---|
MessageWriter(OutputStream out,
boolean chunked)
Creates new writer on top of given output stream. |
Method Summary | |
---|---|
(package private) void |
flush()
Flushes written data to underlying output stream. |
private void |
updateState(int oldState,
int newState)
|
(package private) void |
writeContent(byte[] b,
int off,
int len)
Writes message content. |
(package private) void |
writeHeader(Header header)
"Writes" HTTP message header (the header may not actually be written until after the message content length is known). |
(package private) static void |
writeLine(OutputStream out,
String line)
Writes line to given output stream in ASCII, terminated by HTTP end-of-line sequence "\r\n". |
(package private) void |
writeStartLine(StartLine line)
Writes HTTP message start line. |
(package private) void |
writeTrailer(Header trailer)
Writes message trailer (if not using chunked output, merges trailer with header before writing), completing message output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int CHUNK_SIZE
private static final int START
private static final int HEADER
private static final int CONTENT
private static final int DONE
private final OutputStream out
private final OutputStream cout
private int state
private Header header
Constructor Detail |
---|
MessageWriter(OutputStream out, boolean chunked)
Method Detail |
---|
void writeStartLine(StartLine line) throws IOException
IOException
void writeHeader(Header header) throws IOException
IOException
void writeContent(byte[] b, int off, int len) throws IOException
IOException
void writeTrailer(Header trailer) throws IOException
IOException
void flush() throws IOException
IOException
static void writeLine(OutputStream out, String line) throws IOException
IOException
private void updateState(int oldState, int newState)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |