public class ContentChannelOutputStream extends OutputStream implements com.yahoo.io.WritableByteTransmitter
Modifier and Type | Class and Description |
---|---|
(package private) class |
ContentChannelOutputStream.LoggingCompletionHandler |
Modifier and Type | Field and Description |
---|---|
private com.yahoo.io.BufferChain |
buffer |
private long |
byteBufferData |
private com.yahoo.jdisc.handler.ContentChannel |
endpoint |
private boolean |
failed |
private Object |
failLock |
private static Logger |
log |
Constructor and Description |
---|
ContentChannelOutputStream(com.yahoo.jdisc.handler.ContentChannel endpoint) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Flush the internal buffers, does not touch the ContentChannel.
|
void |
flush()
Flush the internal buffers, does not touch the ContentChannel.
|
void |
nonCopyingWrite(byte[] b)
Buffered write the contents of the array to this stream,
transferring ownership of that array to this stream.
|
void |
nonCopyingWrite(byte[] b,
int off,
int len)
Buffered write of the contents of the array to this stream,
transferring ownership of that array to this stream.
|
void |
send(ByteBuffer src)
Write a ByteBuffer to the wrapped ContentChannel.
|
void |
write(byte[] b)
Buffered write the contents of the array to this stream,
copying the contents of the given array to this stream.
|
void |
write(byte[] b,
int off,
int len)
Buffered write of the contents of the array to this stream,
copying the contents of the given array to this stream.
|
void |
write(int b)
Buffered write of a single byte.
|
long |
written()
Give the number of bytes written.
|
private static final Logger log
private final com.yahoo.io.BufferChain buffer
private final com.yahoo.jdisc.handler.ContentChannel endpoint
private long byteBufferData
private boolean failed
private final Object failLock
public ContentChannelOutputStream(com.yahoo.jdisc.handler.ContentChannel endpoint)
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
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
b
.write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
b
.write
in class OutputStream
IOException
public void nonCopyingWrite(byte[] b, int off, int len) throws IOException
b
.IOException
public void nonCopyingWrite(byte[] b) throws IOException
b
.IOException
public void send(ByteBuffer src) throws IOException
flush()
before send(ByteBuffer) to
avoid garbled output if the stream API has been accessed before using the
ByteBuffer based API. As with ContentChannel, this transfers ownership of
the ByteBuffer to this stream.send
in interface com.yahoo.io.WritableByteTransmitter
IOException
public long written()
Copyright © 2017. All rights reserved.