2005/5/9

     
 

class JoinedReader

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

acdk::io::JoinedReader Class Reference

#include <JoinedReader.h>

Inheritance diagram for acdk::io::JoinedReader:

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

Detailed Description

Joines multiple Reader to one virtual stream API: ACDK

Author:
Roger Rene Kommer (mailto:kommer@artefaktur.com)
Version:
Revision
1.11
Date:
Date
2005/02/05 10:44:54


Public Member Functions

 JoinedReader (IN(RReader) firstIn, IN(acdk::lang::Object) lock=Nil)
virtual ~JoinedReader ()
void addIn (IN(RReader) in)
virtual RReader getIn ()
virtual void setIn (IN(RReader) in)
virtual int available ()
 returns the number of bytes available in this stream before blocking Some Reader always return 0

virtual void close ()
 closes this Reader.

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

virtual jlong skip (jlong n)
 Move forwart into the stream.

virtual int read ()
 read a single byte from stream

virtual int read (IN(RbyteArray) buffer, 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)
virtual void reset ()
 if mark is set, set stream to mark point otherwise to begin of this stream.

virtual bool ready ()
virtual void mark (int readAheadLimit)
virtual bool markSupported ()
virtual RStorage getStorage ()
virtual RReader getStorageReader ()

Protected Attributes

RReaderArray _ins
int _curPos


Constructor & Destructor Documentation

acdk::io::JoinedReader::JoinedReader IN(RReader firstIn,
IN(acdk::lang::Object lock = Nil
 

virtual acdk::io::JoinedReader::~JoinedReader  )  [virtual]
 


Member Function Documentation

void acdk::io::JoinedReader::addIn IN(RReader in  )  [inline]
 

virtual int acdk::io::JoinedReader::available  )  [inline, virtual]
 

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

Reimplemented from acdk::io::Reader.

virtual void acdk::io::JoinedReader::close  )  [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::Reader.

virtual RReader acdk::io::JoinedReader::getIn  )  [inline, virtual]
 

virtual RStorage acdk::io::JoinedReader::getStorage  )  [inline, virtual]
 

Implements acdk::io::FilterReader.

virtual RReader acdk::io::JoinedReader::getStorageReader  )  [virtual]
 

Implements acdk::io::FilterReader.

virtual void acdk::io::JoinedReader::mark int  readAheadLimit  )  [virtual]
 

Reimplemented from acdk::io::Reader.

virtual bool acdk::io::JoinedReader::markSupported  )  [virtual]
 

Reimplemented from acdk::io::Reader.

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

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

Reimplemented from acdk::io::AbstractReader.

virtual int acdk::io::JoinedReader::read IN(RbyteArray buffer,
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::AbstractReader.

virtual int acdk::io::JoinedReader::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::AbstractReader.

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

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

Reimplemented from acdk::io::Reader.

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

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

Implements acdk::io::AbstractReader.

virtual jlong acdk::io::JoinedReader::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::AbstractReader.

virtual void acdk::io::JoinedReader::setIn IN(RReader in  )  [inline, virtual]
 

Implements acdk::io::FilterReader.

virtual jlong acdk::io::JoinedReader::skip jlong  n  )  [inline, virtual]
 

Move forwart into the stream.

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

Reimplemented from acdk::io::AbstractReader.


Member Data Documentation

int acdk::io::JoinedReader::_curPos [protected]
 

RReaderArray acdk::io::JoinedReader::_ins [protected]