On Wed, 02 Oct 2013 23:29:57 GMT, Mike wrote:

Thanks for the help guys. I asked here because I saw http://vibed.org/api/vibe.stream.base64/Base64OutputStream

Completely forgot about that one. I've implemented it now: https://github.com/rejectedsoftware/vibe.d/commit/0e86f665c24376d2f7cea5eff1a35e0c845305fb

The example then reduces to:

import vibe.core.file : openFile;
import vibe.stream.base64;
import std.stdio : writeln;

auto f = openFile("./text.txt");
scope(exit) f.close();

auto mime64 = new MemoryOutputStream;
auto encoder = new Base64OutputStream(mime64);
encoder.write(f);
writeln(mime64.data);