|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream org.abstracthorizon.danube.http.HTTPBufferedOutputStream
public class HTTPBufferedOutputStream
This is buffered http output stream. It knows how to emit chuncked encoding.
Field Summary | |
---|---|
protected byte[] |
buffer
Buffer |
protected int |
bufferSize
Buffer size |
protected boolean |
chunkEncoding
Chunk encoding |
protected boolean |
closed
Is closed |
protected HTTPConnectionImpl |
connection
Connection |
static String |
CRLF
CR, LF |
protected long |
limitedContentLength
Content length limit |
protected OutputStream |
outputStream
Wrapped output stream |
protected int |
ptr
Pointer in the buffer |
protected int |
sentbytes
Number of sent bytes |
protected boolean |
supporessOutput
Should output be suppressed |
Constructor Summary | |
---|---|
HTTPBufferedOutputStream(HTTPConnectionImpl connection,
OutputStream outputStream,
int defaultBufferSize)
Constructor |
Method Summary | |
---|---|
protected void |
checkBuffer()
Checks if buffer is created |
void |
close()
|
void |
flushImpl()
Implements flushing of the buffer |
int |
getBufferSize()
Returns buffer size |
long |
getLimitedContentLength()
Returns limited content length |
boolean |
isChunkEncoding()
Returns if chunk encoding |
boolean |
isSupporessOutput()
Returns true if output should be suppressed |
void |
resetInternals()
Resets internals |
void |
setBufferSize(int size)
Sets buffer size |
void |
setChunkEncoding(boolean chunkEncoding)
Sets chunk encoding |
void |
setLimitedContentLength(long limitedContentLength)
Sets limited content length |
void |
setSupporessOutput(boolean suppressOutput)
Sets if output should be suppressed or not |
void |
write(byte[] buf)
|
void |
write(byte[] buf,
int start,
int len)
|
void |
write(int b)
|
Methods inherited from class java.io.OutputStream |
---|
flush |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CRLF
protected byte[] buffer
protected int ptr
protected HTTPConnectionImpl connection
protected OutputStream outputStream
protected boolean supporessOutput
protected int bufferSize
protected boolean closed
protected long limitedContentLength
protected int sentbytes
protected boolean chunkEncoding
Constructor Detail |
---|
public HTTPBufferedOutputStream(HTTPConnectionImpl connection, OutputStream outputStream, int defaultBufferSize)
connection
- connectionoutputStream
- wrapped output streamdefaultBufferSize
- default buffer sizeMethod Detail |
---|
public void resetInternals()
public void setSupporessOutput(boolean suppressOutput)
suppressOutput
- should output be suppressedpublic boolean isSupporessOutput()
true
if output should be suppressed
true
if output should be suppressedpublic int getBufferSize()
public void setBufferSize(int size)
size
- buffer size
IOException
- io exceptionpublic long getLimitedContentLength()
public void setLimitedContentLength(long limitedContentLength)
limitedContentLength
- limited content lengthpublic boolean isChunkEncoding()
public void setChunkEncoding(boolean chunkEncoding)
chunkEncoding
- is chunk encodingprotected void checkBuffer() throws IOException
IOException
public void flushImpl() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] buf, int start, int len) throws IOException
write
in class OutputStream
IOException
public void write(byte[] buf) throws IOException
write
in class OutputStream
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |