|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.filter.executor.DefaultIoEventSizeEstimator
public class DefaultIoEventSizeEstimator
A default IoEventSizeEstimator
implementation.
Martin's Java Notes was used for estimation. For unknown types, it inspects declaring fields of the class of the specified event and the parameter of the event. 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.
Constructor Summary | |
---|---|
DefaultIoEventSizeEstimator()
Create a new instance of this class, injecting the known size of basic java types. |
Method Summary | |
---|---|
int |
estimateSize(IoEvent event)
Estimate the IoEvent size in numberof bytes |
int |
estimateSize(java.lang.Object message)
Estimate the size of an Objecr in number of bytes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultIoEventSizeEstimator()
Method Detail |
---|
public int estimateSize(IoEvent event)
estimateSize
in interface IoEventSizeEstimator
event
- The event we want to estimate the size of
public int estimateSize(java.lang.Object message)
message
- The object to estimate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |