Overview

The RoseOutputGzipStream class is a subclass of RoseOutputStream that writes Gzip compressed data to another stream object. The final destination stream is usually a file, but could be any of the other stream subtypes.

RoseOutputFile fs;
RoseOutputGzipStream stream;

FILE * f = fopen ("out.gz", "w");
fs.file(f)

stream.gzdst(&fs);
stream.put("Hello World\n");
stream.flush_final();  // flush and GZ footer.

fs.flush();  // always flush when done.
fclose (f);

Constructor

RoseOutputGzipStream()
RoseOutputGzipStream(RoseOutputStream * bs)

The RoseOutputGzipStream class has a default constructor and one that takes a second stream to initialize the gzdst() field.

flush_final()

int flush_final();

The flush_final() function is called only once, when the application is finished with the output stream. It compresses and writes buffered data like the normal flush() function but then write the final gzip stream footer and checksums.

gzdst()

RoseOutputStream * gzdst()
void gzdst (RoseOutputStream * bs)

The gzdst() function gets and sets the final destination stream that the compressed data will be written to. This is normally a RoseOutputFile instance but could be a different stream type.