Finalize.invoke will be called whenever finalize is called to process remaining input held in buffer.