public class DelegatingSctpChunk extends Object implements SctpChunk
SctpChunk.Type| Modifier | Constructor and Description |
|---|---|
protected |
DelegatingSctpChunk(DefaultSctpChunk chunk) |
| Modifier and Type | Method and Description |
|---|---|
byte |
getFlags() |
Buffer |
getHeader()
Get the raw header of this SCTP Chunk
|
int |
getLength()
This value represents the size of the chunk in bytes, including
the Chunk Type, Chunk Flags, Chunk Length, and Chunk Value fields.
|
int |
getPadding() |
SctpChunk.Type |
getType() |
Buffer |
getValue()
Get the Chunk Value excluding any potential padding that may have
been included on the wire.
|
int |
getValueLength()
The length of the value of the chunk.
|
protected DelegatingSctpChunk(DefaultSctpChunk chunk)
public SctpChunk.Type getType()
public int getLength()
SctpChunkThis value represents the size of the chunk in bytes, including the Chunk Type, Chunk Flags, Chunk Length, and Chunk Value fields. Therefore, if the Chunk Value field is zero-length, the Length field will be set to 4. The Chunk Length field does not count any chunk padding.
Chunks (including Type, Length, and Value fields) are padded out by the sender with all zero bytes to be a multiple of 4 bytes long. This padding MUST NOT be more than 3 bytes in total. The Chunk Length value does not include terminating padding of the chunk. However, it does include padding of any variable-length parameter except the last parameter in the chunk. The receiver MUST ignore the padding.
Note: A robust implementation should accept the chunk whether or not the final padding has been included in the Chunk Length.
(source: RFC 4960 Section 3.2)
public Buffer getHeader()
SctpChunkpublic Buffer getValue()
SctpChunkpublic int getPadding()
getPadding in interface SctpChunkpublic int getValueLength()
SctpChunkNote that the length as encoded into the Chunk "header" includes the 4 bytes containing the size of the fields making up the header. This length is JUST the length of the actual value. Also, it does NOT include padding (if any).
getValueLength in interface SctpChunkCopyright © 2021. All Rights Reserved.