|
||||||||||
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(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. |
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(OutputStream stream, int lengthLimit)
stream
- must be non-null.lengthLimit
- limit of bytes of output.Method Detail |
---|
public void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
len
bytes of data to the output stream,
possibly less if the write limit is reached.
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |