2005/5/9

     
 

class MemReader

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

acdk::io::MemReader Class Reference

#include <MemReader.h>

Inheritance diagram for acdk::io::MemReader:

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

Detailed Description

Provide a Reader interface to a byteArray API: ACDK<br/>.

Deprecated:
use ByteBufferReader
Author:
Roger Rene Kommer (mailto:kommer@artefaktur.com)
Version:
Revision
1.15
Date:
Date
2005/04/09 19:26:45


Public Member Functions

 MemReader (IN(RMemWriter) memwriter, int offset=0, int endpos=-1)
 MemReader (IN(RbyteArray) bytearray, int offset=0, int endpos=-1)
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 RString getDeviceName ()
virtual bool isWriteable ()
virtual bool isReadable ()
virtual void reset ()
 if mark is set, set stream to mark point otherwise to begin of this stream.

virtual bool ready ()
RbyteArray getBuffer ()
bytebegin ()
byteend ()
bytecit ()
int endPos ()

Protected Attributes

RbyteArray _buffer
int _seekPos
 current position

int _endPos
 end of file, if -1 always read end of buffer


Constructor & Destructor Documentation

acdk::io::MemReader::MemReader IN(RMemWriter memwriter,
int  offset = 0,
int  endpos = -1
 

acdk::io::MemReader::MemReader IN(RbyteArray bytearray,
int  offset = 0,
int  endpos = -1
[inline]
 


Member Function Documentation

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

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

Reimplemented from acdk::io::Reader.

byte* acdk::io::MemReader::begin  )  [inline]
 

byte* acdk::io::MemReader::cit  )  [inline]
 

virtual void acdk::io::MemReader::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.

byte* acdk::io::MemReader::end  )  [inline]
 

int acdk::io::MemReader::endPos  )  [inline]
 

RbyteArray acdk::io::MemReader::getBuffer  )  [inline]
 

virtual RString acdk::io::MemReader::getDeviceName  )  [inline, virtual]
 

Returns:
the name of the device. Normally the filename

Implements acdk::io::AbstractStorageReader.

virtual bool acdk::io::MemReader::isReadable  )  [inline, virtual]
 

Returns:
true if Storage is readable

Implements acdk::io::AbstractStorageReader.

virtual bool acdk::io::MemReader::isWriteable  )  [inline, virtual]
 

Returns:
true if Storage is writable

Implements acdk::io::AbstractStorageReader.

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

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

Reimplemented from acdk::io::AbstractReader.

virtual int acdk::io::MemReader::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::MemReader::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::MemReader::ready  )  [virtual]
 

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

Reimplemented from acdk::io::Reader.

virtual void acdk::io::MemReader::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::MemReader::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::MemReader::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

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

int acdk::io::MemReader::_endPos [protected]
 

end of file, if -1 always read end of buffer

int acdk::io::MemReader::_seekPos [protected]
 

current position