org.red5.server.net.filter
Class DefaultMessageSizeEstimator

java.lang.Object
  extended by 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.


Constructor Summary
DefaultMessageSizeEstimator()
           
 
Method Summary
 int estimateSize(IoEvent event)
          
 int estimateSize(Object message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMessageSizeEstimator

public DefaultMessageSizeEstimator()
Method Detail

estimateSize

public int estimateSize(IoEvent event)

Specified by:
estimateSize in interface IoEventSizeEstimator

estimateSize

public int estimateSize(Object message)


Copyright © 2006-2012 The Red5 Project