Worth having a comment to indicate this is needed because write() takes ownership.  I was a bit confused to start with.