Reduced size by 22 bytes by removing writeEmptyArray() and writeEmptyObject()