public final class DefaultMessageSizeEstimator extends java.lang.Object implements MessageSizeEstimator
MessageSizeEstimator
implementation which supports the estimation of the size of
ByteBuf
, ByteBufHolder
and FileRegion
.Modifier and Type | Class and Description |
---|---|
private static class |
DefaultMessageSizeEstimator.HandleImpl |
MessageSizeEstimator.Handle
Modifier and Type | Field and Description |
---|---|
static MessageSizeEstimator |
DEFAULT
Return the default implementation which returns
8 for unknown messages. |
private MessageSizeEstimator.Handle |
handle |
Constructor and Description |
---|
DefaultMessageSizeEstimator(int unknownSize)
Create a new instance
|
Modifier and Type | Method and Description |
---|---|
MessageSizeEstimator.Handle |
newHandle()
Creates a new handle.
|
public static final MessageSizeEstimator DEFAULT
8
for unknown messages.private final MessageSizeEstimator.Handle handle
public DefaultMessageSizeEstimator(int unknownSize)
unknownSize
- The size which is returned for unknown messages.public MessageSizeEstimator.Handle newHandle()
MessageSizeEstimator
newHandle
in interface MessageSizeEstimator