public final class RecordSizeLimitExtension extends HelloExtension
See RFC 8449 for additional details.
HelloExtension.ExtensionType| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_RECORD_SIZE_LIMIT
Maximum value for record size limit.
|
static int |
MIN_RECORD_SIZE_LIMIT
Minimum value for record size limit.
|
LENGTH_BITS, TYPE_BITS| Constructor and Description |
|---|
RecordSizeLimitExtension(int recordSizeLimit)
Create record size limit extension.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addExtensionData(org.eclipse.californium.elements.util.DatagramWriter writer)
Adds binary encoding of this extension's data.
|
static int |
ensureInRange(int recordSizeLimit)
Ensure, that provided record limit is between
MIN_RECORD_SIZE_LIMIT and MAX_RECORD_SIZE_LIMIT. |
static RecordSizeLimitExtension |
fromExtensionDataReader(org.eclipse.californium.elements.util.DatagramReader extensionDataReader,
InetSocketAddress peerAddress)
Create record size limit extension from extensions data bytes.
|
int |
getLength()
Gets the overall length of this extension's corresponding Extension struct.
|
int |
getRecordSizeLimit()
Get record size limit.
|
fromExtensionDataReader, toByteArray, toStringpublic static final int MIN_RECORD_SIZE_LIMIT
public static final int MAX_RECORD_SIZE_LIMIT
public RecordSizeLimitExtension(int recordSizeLimit)
recordSizeLimit - record size limitpublic int getRecordSizeLimit()
public int getLength()
HelloExtensionNote that this includes the 2 bytes indicating the extension type.
getLength in class HelloExtensionprotected void addExtensionData(org.eclipse.californium.elements.util.DatagramWriter writer)
HelloExtensionThis implementation does not do anything. Sub-classes should override this method and use the passed-in writer to add their extension_data bytes to the Extension data structure.
NB: Subclasses MUST NOT write the extension's type code to the writer
as this will already have been done by the HelloExtension.toByteArray() method.
addExtensionData in class HelloExtensionwriter - the writer to use for serializationpublic static RecordSizeLimitExtension fromExtensionDataReader(org.eclipse.californium.elements.util.DatagramReader extensionDataReader, InetSocketAddress peerAddress) throws HandshakeException
extensionDataReader - extension data bytespeerAddress - peer addressNullPointerException - if extensionData is nullHandshakeException - if the extension data could not be decodedpublic static int ensureInRange(int recordSizeLimit)
MIN_RECORD_SIZE_LIMIT and MAX_RECORD_SIZE_LIMIT.recordSizeLimit - record size limit to ensure, that the value is in
range.RecordSizeLimitExtension the provided value, if in rangeIllegalArgumentException - if value is not in rangeCopyright © 2023 Eclipse Foundation. All rights reserved.