2005/5/9

     
 

class BufferedReader

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::io::BufferedReader Class Reference

#include <BufferedReader.h>

Inheritance diagram for acdk::io::BufferedReader:

acdk::io::AbstractFilterReader acdk::io::AbstractReader acdk::io::FilterReader acdk::lang::Object acdk::io::Reader acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch acdk::xml::sax::NamedBufferReader List of all members.

Detailed Description

Buffers input from a given Reader API: ACDK

Author:
Roger Rene Kommer (mailto:kommer@artefaktur.com)
Version:
Revision
1.13
Date:
Date
2005/04/09 19:26:44


Public Member Functions

 BufferedReader (IN(RReader) in, int buffsize=BufferedReader::DEFAULT_BUFFER_SIZE)
virtual void close ()
 closes this Reader.

virtual int available ()
 returns the number of bytes available in this stream before blocking Some Reader always return 0

virtual jlong seek (SeekPos seekrel, jlong seekpos)
 Set stream position in this Reader to given position.

virtual void mark (int readlimit)
virtual bool markSupported ()
virtual void reset ()
 if mark is set, set stream to mark point otherwise to begin of this stream.

virtual bool ready ()
virtual jlong skip (jlong num_bytes)
 Move forwart into the stream.

virtual int read ()
 read a single byte from stream

virtual int read (IN(RbyteArray) buf, int offset=0, int len=-1)
 read the len bytes into buffer at offset of the buffer

virtual int read (byte *buffer, int offset, int len)

Protected Attributes

RbyteArray _buffer
int _count
int _pos
int _markpos
int _marklimit
RbyteArray _markbuf
transient int _markbufpos
transient int _markbufcount
transient bool _doing_reset
transient bool _primed
transient bool _eof

Static Protected Attributes

int DEFAULT_BUFFER_SIZE

Private Member Functions

void _fillBuffer ()


Constructor & Destructor Documentation

acdk::io::BufferedReader::BufferedReader IN(RReader in,
int  buffsize = BufferedReader::DEFAULT_BUFFER_SIZE
 


Member Function Documentation

void acdk::io::BufferedReader::_fillBuffer  )  [private]
 

virtual int acdk::io::BufferedReader::available  )  [virtual]
 

returns the number of bytes available in this stream before blocking Some Reader always return 0

Reimplemented from acdk::io::AbstractFilterReader.

virtual void acdk::io::BufferedReader::close  )  [inline, virtual]
 

closes this Reader.

Note: Some Reader must be closed explicitaly Note: Reader implementation must be avare from closing a reader more than one

Reimplemented from acdk::io::AbstractFilterReader.

virtual void acdk::io::BufferedReader::mark int  readlimit  )  [virtual]
 

Reimplemented from acdk::io::AbstractFilterReader.

virtual bool acdk::io::BufferedReader::markSupported  )  [inline, virtual]
 

Reimplemented from acdk::io::AbstractFilterReader.

virtual int acdk::io::BufferedReader::read byte buffer,
int  offset,
int  len
[inline, virtual]
 

See also:
other read(RbyteArray, int, int)

Reimplemented from acdk::io::AbstractFilterReader.

virtual int acdk::io::BufferedReader::read IN(RbyteArray buf,
int  offset = 0,
int  len = -1
[virtual]
 

read the len bytes into buffer at offset of the buffer

Parameters:
buffer where to write the bytes
offset offset to write into buffer
len how many bytes to read. if == -1 read into many bytes, that fits into buffer (buffer->length() - offset) ``
Returns:
number of bytes readed. may less than input if EOS is reached
Exceptions:
EOF exception, if trying to read behind EOS

Reimplemented from acdk::io::AbstractFilterReader.

virtual int acdk::io::BufferedReader::read  )  [virtual]
 

read a single byte from stream

Returns:
the byte readed or -1 if EOS.
Exceptions:
EOF exception, if trying to read behind EOS

Reimplemented from acdk::io::AbstractFilterReader.

virtual bool acdk::io::BufferedReader::ready  )  [virtual]
 

Returns:
true, if at least 1 byte can be readed from stream

Reimplemented from acdk::io::AbstractFilterReader.

virtual void acdk::io::BufferedReader::reset  )  [virtual]
 

if mark is set, set stream to mark point otherwise to begin of this stream.

Reimplemented from acdk::io::AbstractFilterReader.

virtual jlong acdk::io::BufferedReader::seek SeekPos  seekrel,
jlong  seekpos
[inline, virtual]
 

Set stream position in this Reader to given position.

Returns:
the absolute position in this stream

Reimplemented from acdk::io::AbstractFilterReader.

virtual jlong acdk::io::BufferedReader::skip jlong  num_bytes  )  [virtual]
 

Move forwart into the stream.

Returns:
how many bytes skipped. May less then input, in case EOS is reached

Reimplemented from acdk::io::AbstractFilterReader.


Member Data Documentation

RbyteArray acdk::io::BufferedReader::_buffer [protected]
 

int acdk::io::BufferedReader::_count [protected]
 

transient bool acdk::io::BufferedReader::_doing_reset [protected]
 

transient bool acdk::io::BufferedReader::_eof [protected]
 

RbyteArray acdk::io::BufferedReader::_markbuf [protected]
 

transient int acdk::io::BufferedReader::_markbufcount [protected]
 

transient int acdk::io::BufferedReader::_markbufpos [protected]
 

int acdk::io::BufferedReader::_marklimit [protected]
 

int acdk::io::BufferedReader::_markpos [protected]
 

int acdk::io::BufferedReader::_pos [protected]
 

transient bool acdk::io::BufferedReader::_primed [protected]
 

int acdk::io::BufferedReader::DEFAULT_BUFFER_SIZE [static, protected]