Streaming base64 encoder and buffered url encoded solution