aboutsummaryrefslogtreecommitdiff
path: root/src/tests/sbuffer.cpp
blob: d8bbe4d0ab713b1b4065e1f47b94617f23f3f14e (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: %d\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 );

}