some more handcodings. learnt that calcSize with a NULL-ptr should return the space necessary for allocation else the space necessary for binary serialization