Yeah, I'll replace buffer_encode with one that just takes a writer.