Package com.github.ambry.network
Interface Send
-
- All Superinterfaces:
io.netty.buffer.ByteBufHolder
,io.netty.util.ReferenceCounted
- All Known Subinterfaces:
SendWithCorrelationId
- All Known Implementing Classes:
BoundedByteBufferSend
public interface Send extends io.netty.buffer.ByteBufHolder
Any data that needs to be sent over the network can implement this interface
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description io.netty.buffer.ByteBuf
content()
Return the data which is held by thisByteBufHolder
.boolean
isSendComplete()
Returns true if the all data has been writtenlong
sizeInBytes()
The total size in bytes that needs to be written to the channeldefault void
writeTo(AsyncWritableChannel channel, Callback<java.lang.Long> callback)
Placeholder to supportAsyncWritableChannel
long
writeTo(java.nio.channels.WritableByteChannel channel)
Writes content into the provided channel
-
-
-
Method Detail
-
writeTo
long writeTo(java.nio.channels.WritableByteChannel channel) throws java.io.IOException
Writes content into the provided channel- Parameters:
channel
- The channel into which data needs to be written to- Returns:
- Number of bytes written
- Throws:
java.io.IOException
-
writeTo
default void writeTo(AsyncWritableChannel channel, Callback<java.lang.Long> callback)
Placeholder to supportAsyncWritableChannel
-
isSendComplete
boolean isSendComplete()
Returns true if the all data has been written- Returns:
- True if all the data has been written else false
-
sizeInBytes
long sizeInBytes()
The total size in bytes that needs to be written to the channel- Returns:
- The size of the data in bytes to be written
-
content
io.netty.buffer.ByteBuf content()
Return the data which is held by thisByteBufHolder
.- Specified by:
content
in interfaceio.netty.buffer.ByteBufHolder
-
-