Wrap corking around the `write` method