public class NioSmfUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
SMF2HEADERBLOCKLEN |
static int |
SMF3HEADERBLOCKLEN |
static int |
WORDLEN |
| Constructor and Description |
|---|
NioSmfUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isSmfMessageAvailableAtCurrentPos(ByteBuffer buf) |
static int |
smfSizeReqAtCurrentPos(ByteBuffer buf) |
static void |
validateSmfDeclaredLengthLegal(int smfVersion,
int declaredLength)
Validates that the declared length of the SMF message is at least as long
as the basic SMFv2 or SMFv3 header size.
|
static void |
validateSmfHeaderLengthSane(int smfVersion,
int smfHeaderLenBytes,
int declaredMessageLength)
Validates that the declared SMF header length is at least (8/12) bytes
and doesn't extend past the length of the enclosing message.
|
static void |
validateSmfVersion(int version)
Validates that argument is 2 or 3, if not, throws IOException with good
error message.
|
public static final int SMF2HEADERBLOCKLEN
public static final int SMF3HEADERBLOCKLEN
public static final int WORDLEN
public static boolean isSmfMessageAvailableAtCurrentPos(ByteBuffer buf) throws IOException
IOExceptionpublic static int smfSizeReqAtCurrentPos(ByteBuffer buf) throws IOException
IOExceptionpublic static final void validateSmfVersion(int version)
throws IOException
version - parameterIOException - on errorpublic static final void validateSmfDeclaredLengthLegal(int smfVersion,
int declaredLength)
throws IOException
smfVersion - parameterdeclaredLength - parameterIOException - on errorpublic static final void validateSmfHeaderLengthSane(int smfVersion,
int smfHeaderLenBytes,
int declaredMessageLength)
throws IOException
smfVersion - parametersmfHeaderLenBytes - parameterdeclaredMessageLength - parameterIOException - on errorCopyright 2004-2020 Solace Corporation. All rights reserved.