2005/5/9

     
 

class Reader

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

acdk::io::Reader Class Reference

#include <Reader.h>

Inheritance diagram for acdk::io::Reader:

acdk::io::AbstractReader acdk::io::FilterReader acdk::io::LittleBytesReader acdk::net::TCPSocket acdk::vfile::zip::ZipFileReader acdk::io::AbstractFilterReader acdk::io::AbstractStorageReader acdk::io::ByteBufferReader acdk::io::BytePtrReader acdk::io::CharToByteReader acdk::io::JoinedReader acdk::io::AbstractFilterReader acdk::io::DataReader acdk::io::JoinedReader acdk::io::TeeReader List of all members.

Detailed Description

General byte base reader.

Note:
To implement a reader a function has either to overload read() or read(byte* buffer, int offset, int len);
Author:
Roger Rene Kommer (mailto:kommer@artefaktur.com)
Version:
Revision
1.23
Date:
Date
2005/04/09 19:26:45


Public Member Functions

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.

void closeReader ()
 DMI version of close().

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

virtual jlong skip (jlong n)=0
 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 mark (int readAheadLimit)
virtual bool markSupported ()
virtual void reset ()=0
 if mark is set, set stream to mark point otherwise to begin of this stream.

virtual bool ready ()
RbyteArray readAll ()
 reads until EOF into returned byteArray

void trans (IN(RWriter) out)
 writes reader until EOF into given Writer.

virtual RStorage getReaderStorage ()
virtual RCharReader getCharReader (IN(acdk::locale::RDecoder) decoder=Nil)
 returns a character reader using standard encoding

RString readAllAsString ()
 reads the content as String using standard encoding


Member Function Documentation

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

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

Reimplemented in acdk::io::AbstractFilterReader, acdk::io::BufferedReader, acdk::io::ByteBufferReader, acdk::io::BytePtrReader, acdk::io::LittleBytesReader, acdk::io::CharToByteReader, acdk::io::FileReader, acdk::io::JoinedReader, acdk::io::MemReader, acdk::io::SubReader, acdk::lang::Process_PipeReader, acdk::net::srfsys::FilterObjectReader, acdk::net::TCPSocket, acdk::vfile::InflaterReader, and acdk::vfile::zip::ZipFileReader.

virtual void acdk::io::Reader::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 in acdk::io::AbstractFilterReader, acdk::io::BufferedReader, acdk::io::ByteBufferReader, acdk::io::BytePtrReader, acdk::io::FileReader, acdk::io::JoinedReader, acdk::io::MemReader, acdk::io::PipedReader, acdk::io::RandomAccessFile, acdk::net::srfsys::FilterObjectReader, acdk::net::TCPSocket, acdk::vfile::InflaterReader, and acdk::vfile::zip::ZipFileReader.

void acdk::io::Reader::closeReader  )  [inline]
 

DMI version of close().

virtual RCharReader acdk::io::Reader::getCharReader IN(acdk::locale::RDecoder decoder = Nil  )  [virtual]
 

returns a character reader using standard encoding

Parameters:
decoder use decoder to read from bytes. if Nil uses the system encoding

virtual RStorage acdk::io::Reader::getReaderStorage  )  [virtual]
 

Reimplemented in acdk::io::ByteBufferReader.

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

Reimplemented in acdk::io::AbstractFilterReader, acdk::io::BufferedReader, acdk::io::ByteBufferReader, acdk::io::BytePtrReader, acdk::io::JoinedReader, acdk::io::LineNumberReader, acdk::net::srfsys::FilterObjectReader, acdk::net::TCPSocket, acdk::vfile::InflaterReader, and acdk::vfile::zip::ZipFileReader.

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

Reimplemented in acdk::io::AbstractFilterReader, acdk::io::BufferedReader, acdk::io::ByteBufferReader, acdk::io::BytePtrReader, acdk::io::JoinedReader, acdk::io::PushbackReader, acdk::net::srfsys::FilterObjectReader, acdk::net::TCPSocket, acdk::vfile::InflaterReader, and acdk::vfile::zip::ZipFileReader.

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

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

Reimplemented in acdk::io::AbstractFilterReader, acdk::io::AbstractReader, acdk::io::BinaryObjectReader, acdk::io::BufferedReader, acdk::io::ByteBufferReader, acdk::io::BytePtrReader, acdk::io::LittleBytesReader, acdk::io::CharToByteReader, acdk::io::ConsoleReader, acdk::io::FileReader, acdk::io::JoinedReader, acdk::io::LineNumberReader, acdk::io::MemReader, acdk::io::PipedReader, acdk::io::PushbackReader, acdk::io::RandomAccessFile, acdk::io::SubReader, acdk::io::TeeReader, acdk::lang::Process_PipeReader, acdk::net::srfsys::FilterObjectReader, acdk::net::TCPSocket, acdk::net::TransRateReader, acdk::vfile::InflaterReader, acdk::vfile::zip::ZipFileReader, and acdkx::orb::CDRObjectReader.

virtual int acdk::io::Reader::read IN(RbyteArray buffer,
int  offset = 0,
int  len = -1
[inline, 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 in acdk::io::AbstractFilterReader, acdk::io::AbstractReader, acdk::io::BinaryObjectReader, acdk::io::BufferedReader, acdk::io::ByteBufferReader, acdk::io::BytePtrReader, acdk::io::LittleBytesReader, acdk::io::CharToByteReader, acdk::io::ConsoleReader, acdk::io::FileReader, acdk::io::JoinedReader, acdk::io::LineNumberReader, acdk::io::MemReader, acdk::io::PipedReader, acdk::io::PushbackReader, acdk::io::RandomAccessFile, acdk::io::SubReader, acdk::io::TeeReader, acdk::lang::Process_PipeReader, acdk::net::srfsys::FilterObjectReader, acdk::net::TCPSocket, acdk::net::TransRateReader, acdk::vfile::InflaterReader, acdk::vfile::zip::ZipFileReader, and acdkx::orb::CDRObjectReader.

virtual int acdk::io::Reader::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 in acdk::io::AbstractFilterReader, acdk::io::AbstractReader, acdk::io::BinaryObjectReader, acdk::io::BufferedReader, acdk::io::ByteBufferReader, acdk::io::BytePtrReader, acdk::io::LittleBytesReader, acdk::io::CharToByteReader, acdk::io::ConsoleReader, acdk::io::FileReader, acdk::io::JoinedReader, acdk::io::LineNumberReader, acdk::io::MemReader, acdk::io::PipedReader, acdk::io::PushbackReader, acdk::io::RandomAccessFile, acdk::io::SubReader, acdk::io::TeeReader, acdk::lang::Process_PipeReader, acdk::net::srfsys::FilterObjectReader, acdk::net::TCPSocket, acdk::net::TransRateReader, acdk::vfile::InflaterReader, acdk::vfile::zip::ZipFileReader, and acdkx::orb::CDRObjectReader.

RbyteArray acdk::io::Reader::readAll  ) 
 

reads until EOF into returned byteArray

RString acdk::io::Reader::readAllAsString  ) 
 

reads the content as String using standard encoding

virtual bool acdk::io::Reader::ready  )  [inline, virtual]
 

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

Reimplemented in acdk::io::AbstractFilterReader, acdk::io::BufferedReader, acdk::io::ConsoleReader, acdk::io::FileReader, acdk::io::JoinedReader, acdk::io::MemReader, acdk::io::PipedReader, acdk::io::PushbackReader, acdk::io::RandomAccessFile, acdk::lang::Process_PipeReader, acdk::net::TCPSocket, acdk::vfile::InflaterReader, and acdk::vfile::zip::ZipFileReader.

virtual void acdk::io::Reader::reset  )  [pure virtual]
 

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

Implemented in acdk::io::AbstractFilterReader, acdk::io::AbstractObjectReader, acdk::io::AbstractReader, acdk::io::ASCIIDataReader, acdk::io::BinaryDataReader, acdk::io::BufferedReader, acdk::io::ByteBufferReader, acdk::io::BytePtrReader, acdk::io::LittleBytesReader, acdk::io::CharToByteReader, acdk::io::ConsoleReader, acdk::io::DataReader, acdk::io::FileReader, acdk::io::FilterReader, acdk::io::JoinedReader, acdk::io::LineNumberReader, acdk::io::MemReader, acdk::io::ObjectReader, acdk::io::PipedReader, acdk::io::RandomAccessFile, acdk::net::srfsys::FilterObjectReader, acdk::net::TCPSocket, acdk::vfile::InflaterReader, acdk::vfile::zip::ZipFileReader, and acdkx::orb::CDRObjectReader.

virtual jlong acdk::io::Reader::seek SeekPos  seekrel,
jlong  seekpos
[pure virtual]
 

Set stream position in this Reader to given position.

Returns:
the absolute position in this stream

Implemented in acdk::io::AbstractFilterReader, acdk::io::AbstractObjectReader, acdk::io::AbstractReader, acdk::io::ASCIIDataReader, acdk::io::BinaryDataReader, acdk::io::BufferedReader, acdk::io::ByteBufferReader, acdk::io::BytePtrReader, acdk::io::LittleBytesReader, acdk::io::CharToByteReader, acdk::io::ConsoleReader, acdk::io::DataReader, acdk::io::FileReader, acdk::io::FilterReader, acdk::io::JoinedReader, acdk::io::MemReader, acdk::io::ObjectReader, acdk::io::RandomAccessFile, acdk::net::srfsys::FilterObjectReader, acdk::vfile::InflaterReader, acdk::vfile::zip::ZipFileReader, and acdkx::orb::CDRObjectReader.

virtual jlong acdk::io::Reader::skip jlong  n  )  [pure virtual]
 

Move forwart into the stream.

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

Implemented in acdk::io::AbstractFilterReader, acdk::io::AbstractObjectReader, acdk::io::AbstractReader, acdk::io::ASCIIDataReader, acdk::io::BinaryDataReader, acdk::io::BufferedReader, acdk::io::ByteBufferReader, acdk::io::BytePtrReader, acdk::io::LittleBytesReader, acdk::io::CharToByteReader, acdk::io::DataReader, acdk::io::FileReader, acdk::io::FilterReader, acdk::io::JoinedReader, acdk::io::MemReader, acdk::io::ObjectReader, acdk::io::PushbackReader, acdk::io::RandomAccessFile, acdk::io::SubReader, acdk::net::srfsys::FilterObjectReader, acdk::net::TCPSocket, acdk::vfile::InflaterReader, acdk::vfile::zip::ZipFileReader, and acdkx::orb::CDRObjectReader.

void acdk::io::Reader::trans IN(RWriter out  ) 
 

writes reader until EOF into given Writer.

API: Extended