summaryrefslogtreecommitdiff
path: root/src/tests/bigmyriad.cpp
blob: 6661bf1a14f08e59a325d55af237580f0dfd5650 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#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, 2048 );

	char *buf = new char[1024*1024*10];
	memset( buf, 0, 1024*1024*10 );

	for( int j = 0; j < 250; j++ )
	{
		m.openStream( m.createStream() ).write( buf, 1024*1024*10 );
//		m.sync();
		printf("\r%03d%%", (j+1)*100/250 );
		fflush( stdout );
	}

	printf("\n\n");

	return 0;
}