SizeEstimator class

A utility class for estimating the size of objects in memory.

This class provides more accurate size estimation than the simple string length * 2 approach used in earlier versions.

Constructors

SizeEstimator()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

estimateCacheItemSize(dynamic value, {bool hasExpiry = false, bool hasSlidingExpiry = false, bool isCompressed = false, int? originalSize}) → int
Estimates the size of a cache item in bytes.
estimateJsonSize(String jsonString) → int
Estimates the size of a JSON string in bytes.
estimateSize(dynamic value) → int
Estimates the size of an object in bytes.