2005/5/9

     
 

class ByteBufferReader

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

acdk::io::ByteBufferReader Class Reference

#include <ByteBufferReader.h>

Inheritance diagram for acdk::io::ByteBufferReader:

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

Detailed Description

Reader interface for a ReadByteBuffer.


Public Member Functions

 ByteBufferReader (IN(RReadByteBuffer) buffer)
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 jlong skip (jlong n)
 Move forwart into the stream.

virtual int read ()
 read a single byte from stream

virtual void mark (int readAheadLimit)
virtual bool markSupported ()
virtual void reset ()
 if mark is set, set stream to mark point otherwise to begin of this 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)
RStorage getReaderStorage ()
void close ()
 closes this Reader.


Protected Attributes

RReadByteBuffer _buffer
int _curPos
int _mark


Constructor & Destructor Documentation

acdk::io::ByteBufferReader::ByteBufferReader IN(RReadByteBuffer buffer  )  [inline]
 


Member Function Documentation

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

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

Reimplemented from acdk::io::Reader.

void acdk::io::ByteBufferReader::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::Reader.

RStorage acdk::io::ByteBufferReader::getReaderStorage  )  [inline, virtual]
 

Reimplemented from acdk::io::Reader.

virtual void acdk::io::ByteBufferReader::mark int  readAheadLimit  )  [inline, virtual]
 

Reimplemented from acdk::io::Reader.

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

Reimplemented from acdk::io::Reader.

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

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

Reimplemented from acdk::io::AbstractReader.

virtual int acdk::io::ByteBufferReader::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::ByteBufferReader::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 void acdk::io::ByteBufferReader::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::ByteBufferReader::seek SeekPos  seekrel,
jlong  seekpos
[virtual]
 

Set stream position in this Reader to given position.

Returns:
the absolute position in this stream

Reimplemented from acdk::io::AbstractReader.

virtual jlong acdk::io::ByteBufferReader::skip jlong  n  )  [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

RReadByteBuffer acdk::io::ByteBufferReader::_buffer [protected]
 

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

int acdk::io::ByteBufferReader::_mark [protected]