2005/5/9

     
 

class CharToByteReader

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

acdk::io::CharToByteReader Class Reference

#include <CharToByteReader.h>

Inheritance diagram for acdk::io::CharToByteReader:

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

Detailed Description

Reads from a CharReader and encodes it to a Reader.

Author:
Roger Rene Kommer (mailto:kommer@artefaktur.com)
Version:
Revision
1.7
Date:
Date
2005/03/01 10:12:47


Public Member Functions

 CharToByteReader (IN(RCharReader) cin, IN(acdk::locale::REncoder) encoder=Nil, IN(acdk::lang::Object) iolock=Nil)
virtual int available ()
 returns the number of bytes available in this stream before blocking Some Reader always return 0

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

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

int read (IN(RbyteArray) buffer, int offset=0, int len=-1)
 read the len bytes into buffer at offset of the buffer

int read (byte *buffer, int offset, int len)

Public Attributes

RCharReader _cin
acdk::locale::REncoder _encoder
LittleBytesWriter _buf
int _maxChars


Constructor & Destructor Documentation

acdk::io::CharToByteReader::CharToByteReader IN(RCharReader cin,
IN(acdk::locale::REncoder encoder = Nil,
IN(acdk::lang::Object iolock = Nil
[inline]
 


Member Function Documentation

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

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

Reimplemented from acdk::io::Reader.

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

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

Reimplemented from acdk::io::AbstractReader.

int acdk::io::CharToByteReader::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 from acdk::io::AbstractReader.

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

LittleBytesWriter acdk::io::CharToByteReader::_buf
 

RCharReader acdk::io::CharToByteReader::_cin
 

acdk::locale::REncoder acdk::io::CharToByteReader::_encoder
 

int acdk::io::CharToByteReader::_maxChars