org.mortbay.jetty
public class HttpGenerator extends AbstractGenerator
AbstractGenerator.Output, AbstractGenerator.OutputWriter_buffer, _buffers, _close, _content, _contentBufferSize, _contentLength, _contentWritten, _endp, _head, _header, _headerBufferSize, _last, _method, _noContent, _reason, _state, _status, _uri, _version, STATE_CONTENT, STATE_END, STATE_FLUSHING, STATE_HEADER| Constructor and Description |
|---|
HttpGenerator(Buffers buffers,
EndPoint io,
int headerBufferSize,
int contentBufferSize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContent(Buffer content,
boolean last)
Add content.
|
boolean |
addContent(byte b)
Add content.
|
void |
complete()
Complete the message.
|
void |
completeHeader(HttpFields fields,
boolean allContentAdded) |
long |
flush() |
int |
getBytesBuffered() |
boolean |
isBufferFull() |
boolean |
isEmpty() |
protected int |
prepareUncheckedAddContent()
Prepare buffer for unchecked writes.
|
void |
reset(boolean returnBuffers) |
void |
sendResponse(Buffer response)
send complete response.
|
static void |
setServerVersion(java.lang.String version) |
java.lang.String |
toString() |
getContentBufferSize, getContentWritten, getReason, getReasonBuffer, getSendServerVersion, getState, getUncheckedBuffer, getVersion, increaseContentBufferSize, isCommitted, isComplete, isContentWritten, isHead, isIdle, isPersistent, isState, resetBuffer, sendError, setContentLength, setHead, setPersistent, setRequest, setResponse, setSendServerVersion, setVersionpublic static void setServerVersion(java.lang.String version)
public void reset(boolean returnBuffers)
reset in interface Generatorreset in class AbstractGeneratorpublic void addContent(Buffer content, boolean last) throws java.io.IOException
content - last - java.lang.IllegalArgumentException - if content is immutable.java.lang.IllegalStateException - If the request is not expecting any more content,
or if the buffers are full and cannot be flushed.java.io.IOException - if there is a problem flushing the buffers.public void sendResponse(Buffer response) throws java.io.IOException
response - java.io.IOExceptionpublic boolean addContent(byte b)
throws java.io.IOException
b - bytejava.io.IOExceptionprotected int prepareUncheckedAddContent()
throws java.io.IOException
prepareUncheckedAddContent in class AbstractGeneratorjava.io.IOExceptionpublic boolean isBufferFull()
isBufferFull in interface GeneratorisBufferFull in class AbstractGeneratorpublic void completeHeader(HttpFields fields, boolean allContentAdded) throws java.io.IOException
completeHeader in interface GeneratorcompleteHeader in class AbstractGeneratorjava.io.IOExceptionpublic void complete()
throws java.io.IOException
complete in interface Generatorcomplete in class AbstractGeneratorjava.io.IOExceptionpublic long flush()
throws java.io.IOException
flush in interface Generatorflush in class AbstractGeneratorjava.io.IOExceptionpublic int getBytesBuffered()
public boolean isEmpty()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.