#include <bu/myriad.h>
#include <bu/myriadstream.h>
#include <bu/file.h>

int main()
{
    Bu::File f("big.myr", Bu::File::Read|Bu::File::Write|Bu::File::Create );
    Bu::Myriad m( f, 512, 12 );

#define SSIZE (1024*8) // 1024*1024*10
    char *buf = new char[SSIZE];

    for( int j = 0; j < 25; j++ )
    {
        memset( buf, j, SSIZE );
        m.create( Bu::Myriad::Write ).write( buf, SSIZE );
//        m.sync();
        printf("\r%03d%%", (j+1)*100/25 );
        fflush( stdout );
    }

    printf("\n\n");

    return 0;
}

