Package org.drasyl.handler.stream
Class MessageChunk
java.lang.Object
io.netty.buffer.DefaultByteBufHolder
org.drasyl.handler.stream.MessageChunk
- All Implemented Interfaces:
io.netty.buffer.ByteBufHolder
,io.netty.util.ReferenceCounted
- Direct Known Subclasses:
LastMessageChunk
public class MessageChunk
extends io.netty.buffer.DefaultByteBufHolder
Represents a chunk of a message that is too large to be transmitted as a whole.
- See Also:
-
Constructor Summary
-
Method Summary
Methods inherited from class io.netty.buffer.DefaultByteBufHolder
content, contentToString, copy, duplicate, refCnt, release, release, retain, retain, retainedDuplicate, touch, touch
-
Constructor Details
-
MessageChunk
public MessageChunk(byte msgId, int chunkNo, io.netty.buffer.ByteBuf content) - Parameters:
msgId
- id of the message to which this chunk belongschunkNo
- number of this chunk (starting with0
)content
- message's content portion of this chunk
-
-
Method Details
-
toString
- Overrides:
toString
in classio.netty.buffer.DefaultByteBufHolder
-
msgId
public byte msgId()- Returns:
- id of the message to which this chunk belongs
-
chunkNo
public int chunkNo()- Returns:
- number of this chunk (starting with
0
)
-
replace
- Specified by:
replace
in interfaceio.netty.buffer.ByteBufHolder
- Overrides:
replace
in classio.netty.buffer.DefaultByteBufHolder
-
hashCode
public int hashCode()- Overrides:
hashCode
in classio.netty.buffer.DefaultByteBufHolder
-
equals
- Overrides:
equals
in classio.netty.buffer.DefaultByteBufHolder
-