#define XERR "memorybuf"
#include "memorybuf.ih"

    // by memorystream/memorystream2.cc

MemoryBuf::MemoryBuf(string const &bufSize, bool erase,
                     std::ios::openmode openMode, size_t access)
:
    d_mode(openMode),
    d_bridge(bufSize, erase, access)                                   // 3
{
    noBuffers();

    if ((d_mode & ios::trunc) or not (d_mode & ios::in))        // new stream
        truncate(0);
    else if (d_mode & ios::ate)
        seekoff(0, ios::end);
}
