Add size calculation to Serializable