public class StreamWriter
extends io.netty.channel.ChannelInboundHandlerAdapter
implements com.linkedin.r2.message.stream.entitystream.Writer
Writer implementation that receives data from the Netty pipeline
and writes to the entity stream.| Modifier and Type | Field and Description |
|---|---|
static com.linkedin.data.ByteString |
EOF
The static instance of
ByteString represents the end-of-file of the writer. |
| Constructor and Description |
|---|
StreamWriter(io.netty.channel.ChannelHandlerContext ctx,
long maxContentLength) |
| Modifier and Type | Method and Description |
|---|---|
void |
onAbort(java.lang.Throwable throwable) |
void |
onDataAvailable(com.linkedin.data.ByteString data)
Notifies the writer that bytes are available from the
ChannelPipeline. |
void |
onError(java.lang.Throwable throwable)
Notifies the writer that a
ChannelPipeline error is encountered. |
void |
onInit(com.linkedin.r2.message.stream.entitystream.WriteHandle wh) |
void |
onWritePossible() |
channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic static final com.linkedin.data.ByteString EOF
ByteString represents the end-of-file of the writer.public StreamWriter(io.netty.channel.ChannelHandlerContext ctx,
long maxContentLength)
public void onDataAvailable(com.linkedin.data.ByteString data)
ChannelPipeline.data - Available bytes from the channel pipeline.public void onError(java.lang.Throwable throwable)
ChannelPipeline error is encountered. Only the first invocation
is raised and the subsequent invocations are ignored.throwable - error encountered by the channel pipeline.public void onInit(com.linkedin.r2.message.stream.entitystream.WriteHandle wh)
onInit in interface com.linkedin.r2.message.stream.entitystream.Writerpublic void onWritePossible()
onWritePossible in interface com.linkedin.r2.message.stream.entitystream.Writerpublic void onAbort(java.lang.Throwable throwable)
onAbort in interface com.linkedin.r2.message.stream.entitystream.Writer