public abstract class OutputStreamChannel extends java.io.OutputStream implements java.nio.channels.WritableByteChannel, StreamChannel
| Modifier and Type | Field and Description |
|---|---|
protected long |
bytesWritten |
protected java.nio.channels.WritableByteChannel |
channel |
| Modifier | Constructor and Description |
|---|---|
protected |
OutputStreamChannel(java.nio.channels.WritableByteChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
flushBufferNonBlockingBase(java.nio.ByteBuffer buffer) |
long |
getBytesWritten() |
java.lang.Thread |
getParkedThread()
Return the thread if waiting for read/write on this channel.
|
long |
getParkNanosMax()
Maximum time to wait before giving up read/write on channel
|
java.nio.channels.WritableByteChannel |
getUnderlyingChannel()
Get the underlying
WritableByteChannel. |
boolean |
isSocketToSameHost() |
void |
setParkedThread(java.lang.Thread thread)
Set the thread waiting for read/write on this channel (null to clear).
|
abstract int |
write(java.nio.ByteBuffer src) |
protected int |
writeBuffer(java.nio.ByteBuffer buffer,
java.nio.channels.WritableByteChannel channel) |
protected int |
writeBuffered(java.nio.ByteBuffer src,
java.nio.ByteBuffer channelBuffer)
Common base method to write a given ByteBuffer source via an intermediate
direct byte buffer owned by the implementation of this class (if required).
|
protected int |
writeBufferNoWait(java.nio.ByteBuffer buffer,
java.nio.channels.WritableByteChannel channel) |
abstract void |
writeInt(int v)
Writes an
int value, which is comprised of four bytes,
to the output stream in big-endian format
compatible with DataOutput.writeInt(int). |
protected final java.nio.channels.WritableByteChannel channel
protected volatile long bytesWritten
protected OutputStreamChannel(java.nio.channels.WritableByteChannel channel)
public final boolean isSocketToSameHost()
public final java.nio.channels.WritableByteChannel getUnderlyingChannel()
WritableByteChannel.public abstract int write(java.nio.ByteBuffer src)
throws java.io.IOException
write in interface java.nio.channels.WritableByteChanneljava.io.IOExceptionpublic abstract void writeInt(int v)
throws java.io.IOException
int value, which is comprised of four bytes,
to the output stream in big-endian format
compatible with DataOutput.writeInt(int).v - the int value to be written.java.io.IOException - if an I/O error occurs.DataOutput.writeInt(int)protected final int writeBuffered(java.nio.ByteBuffer src,
java.nio.ByteBuffer channelBuffer)
throws java.io.IOException
java.io.IOExceptionprotected final boolean flushBufferNonBlockingBase(java.nio.ByteBuffer buffer)
throws java.io.IOException
java.io.IOExceptionprotected int writeBuffer(java.nio.ByteBuffer buffer,
java.nio.channels.WritableByteChannel channel)
throws java.io.IOException
java.io.IOExceptionpublic final java.lang.Thread getParkedThread()
StreamChannelgetParkedThread in interface StreamChannelpublic final void setParkedThread(java.lang.Thread thread)
StreamChannelsetParkedThread in interface StreamChannelpublic long getParkNanosMax()
StreamChannelgetParkNanosMax in interface StreamChannelprotected int writeBufferNoWait(java.nio.ByteBuffer buffer,
java.nio.channels.WritableByteChannel channel)
throws java.io.IOException
java.io.IOExceptionpublic final long getBytesWritten()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.