1 //----------------------------------------------------------------------
2 // This software is part of the OpenBeOS distribution and is covered
5 // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
6 //----------------------------------------------------------------------
11 #ifndef _DATA_STREAM_H
12 #define _DATA_STREAM_H
16 class DataStream
: public BPositionIO
{
18 virtual status_t
InitCheck() const = 0;
20 virtual ssize_t
Read(void *buffer
, size_t size
) = 0;
21 virtual ssize_t
ReadAt(off_t pos
, void *buffer
, size_t size
) = 0;
23 virtual ssize_t
Write(const void *buffer
, size_t size
) = 0;
24 virtual ssize_t
WriteAt(off_t pos
, const void *buffer
, size_t size
) = 0;
26 virtual ssize_t
Write(BDataIO
&data
, size_t size
) = 0;
27 virtual ssize_t
WriteAt(off_t pos
, BDataIO
&data
, size_t size
) = 0;
29 virtual ssize_t
Zero(size_t size
) = 0;
30 virtual ssize_t
ZeroAt(off_t pos
, size_t size
) = 0;
32 virtual off_t
Seek(off_t position
, uint32 seek_mode
) = 0;
33 virtual off_t
Position() const = 0;
35 virtual status_t
SetSize(off_t size
) = 0;
38 #endif // _DATA_STREAM_H