DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
DcmOutputStream Class Reference

base class for output streams. More...

Inheritance diagram for DcmOutputStream:

## Public Member Functions
virtual | ~DcmOutputStream ()
| destructor
virtual OFBool | good () const
| returns the status of the stream. More...
virtual OFCondition | status () const
| returns the status of the consumer as an OFCondition object. More...
virtual OFBool | isFlushed () const
| returns true if the stream is flushed, i.e. More...
virtual offile_off_t | avail () const
| returns the minimum number of bytes that can be written with the next call to write(). More...
virtual offile_off_t | write (const void *buf, offile_off_t buflen)
| processes as many bytes as possible from the given input block. More...
virtual void | flush ()
| instructs the stream to flush its internal content until either the stream becomes "flushed" or I/O suspension occurs. More...
virtual offile_off_t | tell () const
| returns the total number of bytes written to the stream so far More...
virtual OFCondition | installCompressionFilter (E_StreamCompression filterType)
| installs a compression filter for the given stream compression type, which should be neither ESC_none nor ESC_unsupported. More...

## Protected Member Functions
| DcmOutputStream (DcmConsumer *initial)
| protected constructor, to be called from derived class constructor More...

## Private Member Functions
| DcmOutputStream (const DcmOutputStream &)
| private unimplemented copy constructor
DcmOutputStream & | operator= (const DcmOutputStream &)
| private unimplemented copy assignment operator

## Private Attributes
DcmConsumer * | current_
| pointer to first node in filter chain
DcmOutputFilter * | compressionFilter_
| pointer to compression filter, NULL if no compression
offile_off_t | tell_
| counter for number of bytes written so far

## Detailed Description

base class for output streams.

This class cannot be instantiated since the constructor is protected.

## Constructor & Destructor Documentation

## ◆ DcmOutputStream()

DcmOutputStream::DcmOutputStream | ( | DcmConsumer * | initial | ) |
| protected

protected constructor, to be called from derived class constructor

Parameters

  initial | initial pointer to first node in filter chain The pointer is not dereferenced in the constructor, so the object pointed to may be initialized later in the subclass constructor.

## Member Function Documentation

## ◆ avail()

virtual offile_off_t DcmOutputStream::avail | ( |  | ) | const
| virtual

returns the minimum number of bytes that can be written with the next call to write().

The DcmObject write methods rely on avail to return a value > 0 if there is no I/O suspension since certain data such as tag and length are only written "en bloc", i.e. all or nothing.

Returns
  minimum of space available in stream

## ◆ flush()

virtual void DcmOutputStream::flush | ( |  | ) |
| virtual

instructs the stream to flush its internal content until either the stream becomes "flushed" or I/O suspension occurs.

After a call to flush(), a call to write() will produce undefined behaviour.

## ◆ good()

virtual OFBool DcmOutputStream::good | ( |  | ) | const
| virtual

returns the status of the stream.

Unless the status is good, the stream will not permit any operation.

Returns
  status, true if good

## ◆ installCompressionFilter()

virtual OFCondition DcmOutputStream::installCompressionFilter | ( | E_StreamCompression | filterType | ) |
| virtual

installs a compression filter for the given stream compression type, which should be neither ESC_none nor ESC_unsupported.

Once a compression filter is active, it cannot be deactivated or replaced during the lifetime of the stream.

Parameters

  filterType | type of compression filter

Returns
  EC_Normal if successful, an error code otherwise

## ◆ isFlushed()

virtual OFBool DcmOutputStream::isFlushed | ( |  | ) | const
| virtual

returns true if the stream is flushed, i.e.

has no more data pending in it's internal state that needs to be flushed before the stream is closed.

Returns
  true if stream is flushed, false otherwise

## ◆ status()

virtual OFCondition DcmOutputStream::status | ( |  | ) | const
| virtual

returns the status of the consumer as an OFCondition object.

Unless the status is good, the consumer will not permit any operation.

Returns
  status, EC_Normal if good

## ◆ tell()

virtual offile_off_t DcmOutputStream::tell | ( |  | ) | const
| virtual

returns the total number of bytes written to the stream so far

Returns
  total number of bytes written to the stream

## ◆ write()

virtual offile_off_t DcmOutputStream::write | ( | const void * | buf,
|  | offile_off_t | buflen
| ) |  |
| virtual

processes as many bytes as possible from the given input block.

Parameters

  buf | pointer to memory block, must not be NULL
  buflen | length of memory block

Returns
  number of bytes actually processed.

The documentation for this class was generated from the following file:

- dcmdata/include/dcmtk/dcmdata/dcostrma.h

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1