implement streaming encoding in CodecPrintWriter