Package com.github.ambry.network
Class BoundedNettyByteBufReceive
- java.lang.Object
-
- com.github.ambry.utils.AbstractByteBufHolder<BoundedNettyByteBufReceive>
-
- com.github.ambry.network.BoundedNettyByteBufReceive
-
- All Implemented Interfaces:
io.netty.buffer.ByteBufHolder
,io.netty.util.ReferenceCounted
public class BoundedNettyByteBufReceive extends com.github.ambry.utils.AbstractByteBufHolder<BoundedNettyByteBufReceive>
A nettyByteBuf
version of Receive to buffer the incoming request or response.
-
-
Constructor Summary
Constructors Constructor Description BoundedNettyByteBufReceive()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.buffer.ByteBuf
content()
boolean
isReadComplete()
long
readFrom(java.nio.channels.ReadableByteChannel channel)
BoundedNettyByteBufReceive
replace(io.netty.buffer.ByteBuf content)
long
sizeRead()
The total size in bytes that needs to receive from the channel It will be initialized only after header is read.
-
-
-
Method Detail
-
isReadComplete
public boolean isReadComplete()
-
readFrom
public long readFrom(java.nio.channels.ReadableByteChannel channel) throws java.io.IOException
- Throws:
java.io.IOException
-
sizeRead
public long sizeRead()
The total size in bytes that needs to receive from the channel It will be initialized only after header is read.- Returns:
- the size of the data in bytes to receive after reading header, otherwise return 0
-
content
public io.netty.buffer.ByteBuf content()
- Specified by:
content
in interfaceio.netty.buffer.ByteBufHolder
- Specified by:
content
in classcom.github.ambry.utils.AbstractByteBufHolder<BoundedNettyByteBufReceive>
-
replace
public BoundedNettyByteBufReceive replace(io.netty.buffer.ByteBuf content)
- Specified by:
replace
in interfaceio.netty.buffer.ByteBufHolder
- Specified by:
replace
in classcom.github.ambry.utils.AbstractByteBufHolder<BoundedNettyByteBufReceive>
-
-