Replace deprecated Buffer.write(). Closes #11