|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
net.noderunner.http.LimitedOutputStream
public class LimitedOutputStream
An OutputStream wrapper which allows only a certain number of bytes to be
output. This is used in conjunction writing HTTP requests or responses
with supplied Content-Length
headers. This stream is
unsynchronized.
LimitedInputStream
Constructor Summary | |
---|---|
LimitedOutputStream(java.io.OutputStream stream,
int lengthLimit)
Constructs a limited output stream. |
Method Summary | |
---|---|
void |
close()
Closes the underlying output stream. |
void |
flush()
Flushes the underlying output stream. |
java.lang.String |
toString()
Returns a debug string. |
void |
write(byte[] b,
int off,
int len)
Writes up to len bytes of data to the output stream,
possibly less if the write limit is reached. |
void |
write(int b)
Writes a byte of data to the output stream, possibly does nothing if the write limit is reached. |
Methods inherited from class java.io.OutputStream |
---|
write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LimitedOutputStream(java.io.OutputStream stream, int lengthLimit)
stream
- must be non-null.lengthLimit
- limit of bytes of output.Method Detail |
---|
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
len
bytes of data to the output stream,
possibly less if the write limit is reached.
write
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |