2005/5/9

     
 

class BufferedWriter

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

acdk::io::BufferedWriter Class Reference

#include <BufferedWriter.h>

Inheritance diagram for acdk::io::BufferedWriter:

acdk::io::AbstractFilterWriter acdk::io::AbstractWriter acdk::io::FilterWriter acdk::lang::Object acdk::io::Writer acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

Buffers input from a given Writer API: ACDK

Author:
Roger Rene Kommer (mailto:kommer@artefaktur.com)
Version:
Revision
1.18
Date:
Date
2005/04/09 19:26:44


Public Member Functions

 BufferedWriter (IN(RWriter) writer, int buffsize=BufferedWriter::DEFAULT_BUFFER_SIZE)
 ~BufferedWriter ()
virtual void flush ()
 writes buffer to underlying writer and flush the underlying writer

virtual void close ()
virtual void write (byte b)
 default implementation: byte cbuf[2]; cbuf[1] = 0; cbuf[0] = c; return write((const byte*)cbuf, 0, 1);

virtual void write (const byte *buf, int offset, int len)
virtual void write (IN(RbyteArray) ch, int offset, int len)
 default implementation: return write(ch->data(), offset, len == -1 ? ch->length() - offset : len);

void overflow ()
 writes the buffer to underlying writer, but doesn't flush it

int getBufferSize ()
void setBufferSize (int newSize)
bool isOverflowed ()

Protected Attributes

RbyteArray _buffer
int _bufferLength
bool _overflowed

Static Protected Attributes

int DEFAULT_BUFFER_SIZE


Constructor & Destructor Documentation

acdk::io::BufferedWriter::BufferedWriter IN(RWriter writer,
int  buffsize = BufferedWriter::DEFAULT_BUFFER_SIZE
 

acdk::io::BufferedWriter::~BufferedWriter  ) 
 


Member Function Documentation

virtual void acdk::io::BufferedWriter::close  )  [virtual]
 

Reimplemented from acdk::io::AbstractFilterWriter.

virtual void acdk::io::BufferedWriter::flush  )  [virtual]
 

writes buffer to underlying writer and flush the underlying writer

See also:
overflow

Reimplemented from acdk::io::AbstractFilterWriter.

int acdk::io::BufferedWriter::getBufferSize  )  [inline]
 

bool acdk::io::BufferedWriter::isOverflowed  )  [inline]
 

void acdk::io::BufferedWriter::overflow  ) 
 

writes the buffer to underlying writer, but doesn't flush it

void acdk::io::BufferedWriter::setBufferSize int  newSize  ) 
 

virtual void acdk::io::BufferedWriter::write IN(RbyteArray ch,
int  offset,
int  len
[inline, virtual]
 

default implementation: return write(ch->data(), offset, len == -1 ? ch->length() - offset : len);

Reimplemented from acdk::io::AbstractFilterWriter.

virtual void acdk::io::BufferedWriter::write const byte buf,
int  offset,
int  len
[virtual]
 

Reimplemented from acdk::io::AbstractFilterWriter.

virtual void acdk::io::BufferedWriter::write byte  b  )  [virtual]
 

default implementation: byte cbuf[2]; cbuf[1] = 0; cbuf[0] = c; return write((const byte*)cbuf, 0, 1);

Reimplemented from acdk::io::AbstractFilterWriter.


Member Data Documentation

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

int acdk::io::BufferedWriter::_bufferLength [protected]
 

bool acdk::io::BufferedWriter::_overflowed [protected]
 

int acdk::io::BufferedWriter::DEFAULT_BUFFER_SIZE [static, protected]