use

inline fun ByteWriteChannel.use(block: ByteWriteChannel.() -> Unit)

Executes block on ByteWriteChannel and close it down correctly whether an exception