2 * Copyright 2003-2008, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
10 #ifndef STREAM_BUFFER_H
11 #define STREAM_BUFFER_H
15 #define MIN_BUFFER_SIZE 512
19 StreamBuffer(BPositionIO
*stream
, size_t bufferSize
, bool toRead
= true);
23 // Determines whether the constructor failed or not
25 ssize_t
Read(void *buffer
, size_t size
);
26 // copy nbytes from the stream into pinto
28 void Write(void *buffer
, size_t size
);
29 // copy nbytes from the stream into pinto
31 off_t
Seek(off_t position
, uint32 seekMode
);
32 // seek the stream to the given position
35 // return the actual position
37 ssize_t
_ReadStream();
38 // Load the stream buffer from the stream
41 // stream object this object is buffering
43 // buffered data from fpStream
45 // number of bytes of memory allocated for fpBuffer
47 // number of bytes of actual data in fpBuffer
49 // current position in the buffer
51 // whether the stream is to be read.