Caveat emptor: this template function is probably not callable outside of src/node_buffer.cc. I point it out because node_buffer.h is a semi-public header.