Add copy helpers to/from a stream.