Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::io::BufferedInStream Class Reference

#include <elm/io/BufferedInStream.h>

+ Inheritance diagram for elm::io::BufferedInStream:

Public Member Functions

 BufferedInStream (InStream &input, int size=default_size)
 
virtual ~BufferedInStream (void)
 
virtual int read (void *buffer, int size)
 
- Public Member Functions inherited from elm::io::InStream
virtual ~InStream (void)
 
virtual int read (void)
 
virtual CString lastErrorMessage (void)
 

Static Public Attributes

static const int default_size = 4096
 
- Static Public Attributes inherited from elm::io::InStream
static const int FAILED = -1
 
static const int ENDED = -2
 
static InStreamnull = _null
 

Detailed Description

Input stream providing bufferization for reading another stream.

Constructor & Destructor Documentation

elm::io::BufferedInStream::BufferedInStream ( InStream input,
int  size = default_size 
)

Build a buffered input stream.

Parameters
inputInput stream to get data from.
sizeDefault size of the used buffer.
elm::io::BufferedInStream::~BufferedInStream ( void  )
virtual

Member Function Documentation

int elm::io::BufferedInStream::read ( void *  buffer,
int  size 
)
virtual

Read some bytes from the stream and store them in the given buffer. This method does not ever read as many bytes as available in the buffer even if the stream is not ended. Insteadn a read returning 0 bytes means the end of stream is reached.

Parameters
bufferBuffer to write bytes in.
sizeSize of the buffer.
Returns
Number of read bytes, 0 for end of stream, -1 for an error.

Implements elm::io::InStream.

References elm::io::InStream::read().

Member Data Documentation

const int elm::io::BufferedInStream::default_size = 4096
static

The documentation for this class was generated from the following files: