abstract base class for input streams.
More...
|
virtual | ~DcmInputStream () |
| destructor
|
|
virtual OFBool | good () const |
| returns the status of the stream. More...
|
|
virtual OFCondition | status () const |
| returns the status of the stream as an OFCondition object. More...
|
|
virtual OFBool | eos () |
| returns true if the producer is at the end of stream. More...
|
|
virtual offile_off_t | avail () |
| returns the minimum number of bytes that can be read with the next call to read(). More...
|
|
virtual offile_off_t | read (void *buf, offile_off_t buflen) |
| reads as many bytes as possible into the given block. More...
|
|
virtual offile_off_t | skip (offile_off_t skiplen) |
| skips over the given number of bytes (or less) More...
|
|
virtual offile_off_t | tell () const |
| returns the total number of bytes read from 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...
|
|
virtual DcmInputStreamFactory * | newFactory () const =0 |
| creates a new factory object for the current stream and stream position. More...
|
|
virtual void | mark () |
| marks the current stream position for a later putback operation, overwriting a possibly existing prior putback mark. More...
|
|
virtual void | putback () |
| resets the stream to the position previously marked with setPutbackMark(). More...
|
|
abstract base class for input streams.
◆ DcmInputStream()
DcmInputStream::DcmInputStream |
( |
DcmProducer * |
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. |
◆ avail()
virtual offile_off_t DcmInputStream::avail |
( |
| ) |
|
|
virtual |
returns the minimum number of bytes that can be read with the next call to read().
The DcmObject read 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 read "en bloc", i.e. all or nothing.
- Returns
- minimum of data available in producer
◆ eos()
virtual OFBool DcmInputStream::eos |
( |
| ) |
|
|
virtual |
returns true if the producer is at the end of stream.
- Returns
- true if end of stream, false otherwise
◆ good()
virtual OFBool DcmInputStream::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()
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
◆ mark()
virtual void DcmInputStream::mark |
( |
| ) |
|
|
virtual |
marks the current stream position for a later putback operation, overwriting a possibly existing prior putback mark.
The DcmObject read methods rely on the possibility to putback up to 132 bytes for transfer syntax detection, parse error recovery etc. Implementations of this class should guarantee a putback capability of at least 1 kbyte.
◆ newFactory()
creates a new factory object for the current stream and stream position.
When activated, the factory will be able to create new DcmInputStream delivering the same data as the current stream. Used to defer loading of value fields until accessed. If no factory object can be created (e.g. because the stream is not seekable), returns NULL.
- Returns
- pointer to new factory object if successful, NULL otherwise.
Implemented in DcmInputFileStream, and DcmInputBufferStream.
◆ putback()
virtual void DcmInputStream::putback |
( |
| ) |
|
|
virtual |
resets the stream to the position previously marked with setPutbackMark().
If the putback operation fails (no putback mark set or putback buffer exceeded), status of the producer switches to bad.
◆ read()
virtual offile_off_t DcmInputStream::read |
( |
void * |
buf, |
|
|
offile_off_t |
buflen |
|
) |
| |
|
virtual |
reads as many bytes as possible into the given block.
- Parameters
-
buf | pointer to memory block, must not be NULL |
buflen | length of memory block |
- Returns
- number of bytes actually read.
◆ skip()
virtual offile_off_t DcmInputStream::skip |
( |
offile_off_t |
skiplen | ) |
|
|
virtual |
skips over the given number of bytes (or less)
- Parameters
-
skiplen | number of bytes to skip |
- Returns
- number of bytes actually skipped.
◆ status()
returns the status of the stream as an OFCondition object.
Unless the status is good, the stream will not permit any operation.
- Returns
- status, EC_Normal if good
◆ tell()
virtual offile_off_t DcmInputStream::tell |
( |
| ) |
const |
|
virtual |
returns the total number of bytes read from the stream so far
- Returns
- total number of bytes read from the stream
Referenced by DcmFileCache::init().
The documentation for this class was generated from the following file:
- dcmdata/include/dcmtk/dcmdata/dcistrma.h