writeFunction

WriteBuffer extension function to call for encoding