> I was fooled with the: outBuf ~= buf.idup;

Hm... outBuf *could* be changed to a single string, and then you could remove the idup.  In fact, that would probably be better performing :)

I can see why this was confusing.