decaf::util::zip::DeflaterOutputStream Class Reference
Provides a FilterOutputStream instance that compresses the data before writing it to the wrapped OutputStream.
More...
#include <src/main/decaf/util/zip/DeflaterOutputStream.h>
Public Member Functions |
| | DeflaterOutputStream (decaf::io::OutputStream *outputStream, bool own=false) |
| | Creates a new DeflateOutputStream with a Default Deflater and buffer size.
|
| | DeflaterOutputStream (decaf::io::OutputStream *outputStream, Deflater *deflater, bool own=false, bool ownDeflater=false) |
| | Creates a new DeflateOutputStream with a user supplied Deflater and a default buffer size.
|
| | DeflaterOutputStream (decaf::io::OutputStream *outputStream, Deflater *deflater, int bufferSize, bool own=false, bool ownDeflater=false) |
| | Creates a new DeflateOutputStream with a user supplied Deflater and specified buffer size.
|
| virtual | ~DeflaterOutputStream () |
| virtual void | finish () |
| | Finishes writing any remaining data to the wrapped OutputStream but does not close it upon completion.
|
| virtual void | close () |
| | Closes this object and deallocates the appropriate resources.The object is generally no longer usable after calling close.- Exceptions:
-
The default implementation of this method does nothing.The close method of FilterOutputStream calls its flush method, and then calls the close method of its underlying output stream.
|
Protected Member Functions |
| virtual void | doWriteByte (unsigned char value) |
| virtual void | doWriteArrayBounded (const unsigned char *buffer, int size, int offset, int length) |
| virtual void | deflate () |
| | Writes a buffers worth of compressed data to the wrapped OutputStream.
|
Protected Attributes |
| Deflater * | deflater |
| | The Deflater for this stream.
|
| std::vector< unsigned char > | buf |
| | The Buffer to use for.
|
| bool | ownDeflater |
| bool | isDone |
Static Protected Attributes |
| static const std::size_t | DEFAULT_BUFFER_SIZE |
Detailed Description
Provides a FilterOutputStream instance that compresses the data before writing it to the wrapped OutputStream.
- Since:
- 1.0
Constructor & Destructor Documentation
| decaf::util::zip::DeflaterOutputStream::DeflaterOutputStream |
( |
decaf::io::OutputStream * |
outputStream, |
|
|
bool |
own = false | |
|
) |
| | |
Creates a new DeflateOutputStream with a Default Deflater and buffer size.
- Parameters:
-
| outputStream | The OutputStream instance to wrap. |
| own | Should this filter take ownership of the OutputStream pointer (default is false). |
| decaf::util::zip::DeflaterOutputStream::DeflaterOutputStream |
( |
decaf::io::OutputStream * |
outputStream, |
|
|
Deflater * |
deflater, |
|
|
bool |
own = false, |
|
|
bool |
ownDeflater = false | |
|
) |
| | |
Creates a new DeflateOutputStream with a user supplied Deflater and a default buffer size.
When the user supplied a Deflater instance the DeflaterOutpotStream does not take ownership of the Deflater pointer unless the ownDeflater parameter is set to true, the caller is still responsible for deleting the Deflater when ownDeflater is false.
- Parameters:
-
| outputStream | The OutputStream instance to wrap. |
| deflater | The user supplied Deflater to use for compression. ( |
| own | Should this filter take ownership of the OutputStream pointer (default is false). |
| ownDeflater | Should the filter take ownership of the passed Deflater object (default is false). |
- Exceptions:
-
| NullPointerException | if the Deflater given is NULL. |
| decaf::util::zip::DeflaterOutputStream::DeflaterOutputStream |
( |
decaf::io::OutputStream * |
outputStream, |
|
|
Deflater * |
deflater, |
|
|
int |
bufferSize, |
|
|
bool |
own = false, |
|
|
bool |
ownDeflater = false | |
|
) |
| | |
Creates a new DeflateOutputStream with a user supplied Deflater and specified buffer size.
When the user supplied a Deflater instance the DeflaterOutpotStream does not take ownership of the Deflater pointer unless the ownDeflater parameter is set to true, otherwise the caller is still responsible for deleting the Deflater.
- Parameters:
-
| outputStream | The OutputStream instance to wrap. |
| deflater | The user supplied Deflater to use for compression. |
| bufferSize | The size of the input buffer. |
| own | Should this filter take ownership of the OutputStream pointer (default is false). |
| ownDeflater | Should the filter take ownership of the passed Deflater object (default is false). |
- Exceptions:
-
| NullPointerException | if the Deflater given is NULL. |
| IllegalArgumentException | if bufferSize is 0. |
| virtual decaf::util::zip::DeflaterOutputStream::~DeflaterOutputStream |
( |
|
) |
[virtual] |
Member Function Documentation
| virtual void decaf::util::zip::DeflaterOutputStream::close |
( |
|
) |
[virtual] |
Closes this object and deallocates the appropriate resources.The object is generally no longer usable after calling close.
- Exceptions:
-
The default implementation of this method does nothing.The close method of
FilterOutputStream calls its flush method, and then calls the close method of its underlying output stream.
Finishes writing any remaining data to the OutputStream then closes the stream.
Reimplemented from decaf::io::FilterOutputStream.
| virtual void decaf::util::zip::DeflaterOutputStream::deflate |
( |
|
) |
[protected, virtual] |
Writes a buffers worth of compressed data to the wrapped OutputStream.
| virtual void decaf::util::zip::DeflaterOutputStream::doWriteArrayBounded |
( |
const unsigned char * |
buffer, |
|
|
int |
size, |
|
|
int |
offset, |
|
|
int |
length | |
|
) |
| | [protected, virtual] |
| virtual void decaf::util::zip::DeflaterOutputStream::doWriteByte |
( |
unsigned char |
value |
) |
[protected, virtual] |
| virtual void decaf::util::zip::DeflaterOutputStream::finish |
( |
|
) |
[virtual] |
Finishes writing any remaining data to the wrapped OutputStream but does not close it upon completion.
- Exceptions:
-
| IOException | if an I/O error occurs. |
Field Documentation
The documentation for this class was generated from the following file: