org.red5.server.net.filter
Class DefaultMessageSizeEstimator
java.lang.Object
org.red5.server.net.filter.DefaultMessageSizeEstimator
- All Implemented Interfaces:
- IoEventSizeEstimator
public class DefaultMessageSizeEstimator
- extends Object
- implements IoEventSizeEstimator
A default MessageSizeEstimator
implementation.
Martin's Java Notes were used for estimation of the size of non-IoBuffers. For unknown types, it inspects declaring
fields of the class of the specified message. The size of unknown declaring fields are approximated to the specified
averageSizePerField (default: 64).
All the estimated sizes of classes are cached for performance improvement.
This originated from the Mina sandbox.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultMessageSizeEstimator
public DefaultMessageSizeEstimator()
estimateSize
public int estimateSize(IoEvent event)
-
- Specified by:
estimateSize
in interface IoEventSizeEstimator
estimateSize
public int estimateSize(Object message)
Copyright © 2006-2012 The Red5 Project