2005/5/9

     
 

class BytePtrReader

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

acdk::io::BytePtrReader Class Reference

#include <BytePtrReader.h>

Inheritance diagram for acdk::io::BytePtrReader:

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

Detailed Description

internal reader class.

ptr must be owned by other class


Public Member Functions

 BytePtrReader (const byte *begin, int len)
 BytePtrReader (const byte *begin, const byte *end)
virtual bool markSupported ()
virtual void mark (int readAheadLimit)
 note: readAheadLimit will be ignored

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

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.

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)
void close ()
 closes this Reader.


Protected Attributes

const byte_begin
const byte_end
const byte_ptr
const byte_mark


Constructor & Destructor Documentation

acdk::io::BytePtrReader::BytePtrReader const byte begin,
int  len
[inline]
 

acdk::io::BytePtrReader::BytePtrReader const byte begin,
const byte end
[inline]
 


Member Function Documentation

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

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

note: readAheadLimit will be ignored

Reimplemented from acdk::io::Reader.

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

Reimplemented from acdk::io::Reader.

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

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

Reimplemented from acdk::io::AbstractReader.

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

int acdk::io::BytePtrReader::read  )  [inline, 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::BytePtrReader::reset  )  [inline, virtual]
 

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

Implements acdk::io::AbstractReader.

virtual jlong acdk::io::BytePtrReader::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::BytePtrReader::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

const byte* acdk::io::BytePtrReader::_begin [protected]
 

const byte* acdk::io::BytePtrReader::_end [protected]
 

const byte* acdk::io::BytePtrReader::_mark [protected]
 

const byte* acdk::io::BytePtrReader::_ptr [protected]