public class ChannelBufferOutputStream extends OutputStreamChannel
Note that the close() method of this class does not closing the underlying channel.
| Modifier and Type | Field and Description |
|---|---|
protected ByteBuffer |
buffer |
static int |
DEFAULT_BUFFER_SIZE |
channel, PARK_NANOS, PARK_NANOS_MAX, parkedThread| Constructor and Description |
|---|
ChannelBufferOutputStream(WritableByteChannel channel) |
ChannelBufferOutputStream(WritableByteChannel channel,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
protected ByteBuffer |
allocateBuffer(int bufferSize) |
void |
close() |
void |
flush() |
protected void |
flushBufferBlocking(ByteBuffer buffer) |
boolean |
isOpen() |
void |
write(byte[] b,
int off,
int len) |
int |
write(ByteBuffer src) |
void |
write(int b) |
flushBufferNonBlocking, getParkedThread, getUnderlyingChannel, writeBuffer, writeBuffered, writeBufferNonBlockingwriteprotected final ByteBuffer buffer
public static final int DEFAULT_BUFFER_SIZE
public ChannelBufferOutputStream(WritableByteChannel channel) throws IOException
IOExceptionpublic ChannelBufferOutputStream(WritableByteChannel channel, int bufferSize) throws IOException
IOExceptionprotected ByteBuffer allocateBuffer(int bufferSize)
public final void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic final void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic final int write(ByteBuffer src) throws IOException
write in interface WritableByteChannelwrite in class OutputStreamChannelIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic final boolean isOpen()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in class OutputStreamIOExceptionprotected void flushBufferBlocking(ByteBuffer buffer) throws IOException
IOExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.