HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_SCFReader Class Reference

Interface for reading Seekable Compressed Format (SCF) files. More...

#include <UT_SCFReader.h>

Public Member Functions

 UT_SCFReader ()
 
 ~UT_SCFReader ()
 
UT_IStreamgetInputStream (const char *filename)
 
UT_IStreamgetInputStream (UT_IStream *stream)
 
UT_IStreamgetFilteredInputStream () const
 
void stealStreams (UT_UniquePtr< UT_IStream > &filter, UT_UniquePtr< UT_IStream > &substream)
 
void close ()
 When you open a blosc stream, there are two. More...
 

Detailed Description

Interface for reading Seekable Compressed Format (SCF) files.

Definition at line 21 of file UT_SCFReader.h.

Constructor & Destructor Documentation

UT_SCFReader::UT_SCFReader ( )
UT_SCFReader::~UT_SCFReader ( )

Member Function Documentation

void UT_SCFReader::close ( )

When you open a blosc stream, there are two.

Closes the reader.

UT_IStream* UT_SCFReader::getFilteredInputStream ( ) const
inline

Provided the SCFReader has already been opened with getInputStream, this allows you to regain the filtered stream that it owns.

Definition at line 49 of file UT_SCFReader.h.

UT_IStream* UT_SCFReader::getInputStream ( const char *  filename)

Retrieves a stream that the uncompressed data can be read from. it has been given the index if available and is fully seekable.

Parameters
filenameThe name of the file to open
UT_IStream* UT_SCFReader::getInputStream ( UT_IStream stream)

Retrieves a stream that the uncompressed data can be read from. it has been given the index if available and is fully seekable.

Parameters
streamThe stream to be used as raw input
Returns
the stream to read decompressed data from or NULL if unable to open file.

The input stream needs to exist for the lifetime of the blosc stream returned. The UT_SCFReader doesn't take ownership of the input stream passed in.

The UT_SCFReader does maintain ownership of the stream returned. You should not clear this stream unless you steal ownership of the streams (see stealStreams()).

void UT_SCFReader::stealStreams ( UT_UniquePtr< UT_IStream > &  filter,
UT_UniquePtr< UT_IStream > &  substream 
)

The UT_SCFReader typically takes ownership of two streams

  • the filter stream (which is used to read the data)
  • a "sub-stream" of the compressed data from the input stream The reader usually deletes these streams on closing/destruction. If you steal these streams, then it's safe to destroy the UT_SCFReader. Though you become responsible for deleting the streams.

It's possible the stream pointers may be NULL pointers if there have been errors, or they have been stolen already.

Note
You cannot steal streams if you acquired the input stream by passing a filename.

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