public class BufferedOutputStream extends OutputStream
BufferedOutputStream which does a better job
of buffer packing. The intent is to reduce the amount of packets sent over a
network. Any exception thrown by the underlying stream causes it to be
automatically closed. When the stream is closed, all write operations throw
an IOException.| Constructor and Description |
|---|
BufferedOutputStream(OutputStream out) |
BufferedOutputStream(OutputStream out,
int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
disconnect() |
void |
drain()
Ensures at least one byte can be written, blocking if necessary.
|
void |
flush() |
boolean |
isReady() |
boolean |
outputSuspend() |
int |
setBufferSize(int size)
Sets the size of the buffer, returning the actual size applied.
|
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
writepublic BufferedOutputStream(OutputStream out)
public BufferedOutputStream(OutputStream out, int size)
public void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic boolean isReady()
throws IOException
IOExceptionpublic int setBufferSize(int size)
public void drain()
throws IOException
IOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void disconnect()
public boolean outputSuspend()
throws IOException
IOExceptionCopyright © 2006–2015 Cojen. All rights reserved.