aboutsummaryrefslogtreecommitdiff
path: root/src/old/tests/sbuffer.cpp
blob: 02798cb5f1ec72dc5bf6fea537e98b6c362a2c81 (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
26
27
#include "sbuffer.h"

int main()
{
	SBuffer buf;

	buf.write("abcdefg", 7 );

	printf("tell: %ld\n", buf.tell() );

	char abuf[6];
	int nRead;
	nRead = buf.read( abuf, 5 );
	abuf[nRead] = '\0';
	printf("Read %d bytes \"%s\"\n", nRead, abuf );

	buf.setPos( 0 );
	nRead = buf.read( abuf, 5 );
	abuf[nRead] = '\0';
	printf("Read %d bytes \"%s\"\n", nRead, abuf );

	nRead = buf.read( abuf, 5 );
	abuf[nRead] = '\0';
	printf("Read %d bytes \"%s\"\n", nRead, abuf );

}