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
Modifier and TypeInterfaceDescriptionstatic class
static class
static enum
Type of the entity writer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
Flushes the writen objects.io.netty.handler.stream.ChunkedInput
Get the netty Chunked Input to be written.static NettyEntityWriter
getInstance
(ClientRequest clientRequest, io.netty.channel.Channel channel) long
Get the length of the entity written to theOutputStream
Get theOutputStream
used to write an entitygetType()
Return Type ofvoid
Writes the Object to the channelvoid
writeAndFlush
(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 theOutputStream
used 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
-