Interface NettyEntityWriter
- All Known Implementing Classes:
NettyEntityWriter.DelayedEntityWriter,NettyEntityWriter.DirectEntityWriter
public interface NettyEntityWriter
The Entity Writer is used to write entity in Netty. One implementation is delayed,
so that the complete message length can be set to Content-Length header.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classstatic enumType of the entity writer. -
Method Summary
Modifier and TypeMethodDescriptionvoidflush()Flushes the writen objects.io.netty.handler.stream.ChunkedInputGet the netty Chunked Input to be written.static NettyEntityWritergetInstance(ClientRequest clientRequest, io.netty.channel.Channel channel) longGet the length of the entity written to theOutputStreamGet theOutputStreamused to write an entitygetType()Return Type ofvoidWrites the Object to the channelvoidwriteAndFlush(Object object) Writes the Object to the channel and flush.
-
Method Details
-
write
Writes the Object to the channel- Parameters:
object- object to be written
-
writeAndFlush
Writes the Object to the channel and flush.- Parameters:
object- object to be written
-
flush
Flushes the writen objects. Can throw IOException.- Throws:
IOException
-
getChunkedInput
io.netty.handler.stream.ChunkedInput getChunkedInput()Get the netty Chunked Input to be written.- Returns:
- The Chunked input instance
-
getOutputStream
OutputStream getOutputStream()Get theOutputStreamused to write an entity- Returns:
- the OutputStream to write an entity
-
getLength
long getLength()Get the length of the entity written to theOutputStream- Returns:
-
getType
NettyEntityWriter.Type getType()Return Type of- Returns:
-
getInstance
-