HCOLL-284 resize the copying buffer before serialization