public class LimitedOutputStream extends OutputStream
Content-Length headers. This stream is
unsynchronized.LimitedInputStream| Constructor and Description |
|---|
LimitedOutputStream(OutputStream stream,
int lengthLimit)
Constructs a limited output stream.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
writepublic LimitedOutputStream(OutputStream stream, int lengthLimit)
stream - must be non-null.lengthLimit - limit of bytes of output.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic 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 OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionCopyright © 2012. All Rights Reserved.