#import <ObjectiveLib/ZlibOutStream.h>
Inheritance diagram for OLZlibOutStream:
Public Member Functions | |
(void) | - close |
Close the stream. | |
(void) | - freeStreamResources |
Free the stream's resources. | |
(unsigned) | - writeBytes:count: |
Write a sequence of bytes to the stream. | |
Initializers and Deallocators | |
(id) | - initWithOutStream: |
Initialize the compression stream. | |
(id) | - initWithOutStream:compressionLevel: |
Initialize the compression stream. | |
(id) | - initWithOutStream:compressionLevel:bufferSize: |
Initialize the compression stream. | |
(id) | - initWithOutStream:compressionLevel:bufferSize:writeZlibHeader: |
Initialize the compression stream. | |
Static Public Member Functions | |
(id) | + streamWithOutStream: |
Create and return a new compression stream. | |
(id) | + streamWithOutStream:compressionLevel: |
Create and return a new compression stream. | |
Protected Attributes | |
uint8_t * | buffer |
The buffer required by zlib. | |
unsigned | bufferSize |
The size of the zlib buffer. | |
BOOL | isFinished |
Indicator of whether the compression has finished yet. | |
z_stream_s * | zstream |
The opaque data type used by zlib to represent the stream. |
This is a concrete layered stream that compresses all data written using the library zlib.
- (void) close |
Close the stream.
After receiving this message the stream will no longer be available for writing.
OLInputOutputException | if there is an error closing the stream |
Reimplemented from OLLayeredOutStream.
Reimplemented in OLGzipOutStream.
- (void) freeStreamResources |
Free the stream's resources.
This secondary freeing method is necessary to allow the reference count to be properly manipulated from within the normal free (OLReferenceCountedStream) method.
Reimplemented from OLLayeredOutStream.
Reimplemented in OLGzipOutStream.
- (id) initWithOutStream: | (OLOutStream *) | underStream |
Initialize the compression stream.
The stream uses the default compression level and a buffer size of 1,024. The given out stream underStream is the next lower stream in the stream stack.
OLInputOutputException | if the stream cannot be created for deflation |
underStream | the next lower stream in the stack |
Reimplemented from OLLayeredOutStream.
- (id) initWithOutStream: | (OLOutStream *) | underStream | ||
compressionLevel: | (int) | level | ||
Initialize the compression stream.
The stream uses the given compression level and a buffer size of 1,024. The given out stream underStream is the next lower stream in the stream stack.
OLInvalidArgumentException | if the compression level is not in the range [0,9] | |
OLInputOutputException | if the stream cannot be created for deflation |
underStream | the next lower stream in the stack | |
level | the compression level which must be in the range [0,9] |
- (id) initWithOutStream: | (OLOutStream *) | underStream | ||
compressionLevel: | (int) | level | ||
bufferSize: | (unsigned) | size | ||
Initialize the compression stream.
The stream uses the given compression level and buffer size. The given out stream underStream is the next lower stream in the stream stack.
OLInvalidArgumentException | if the compression level is not in the range [0,9] | |
OLInputOutputException | if the stream cannot be created for deflation |
underStream | the next lower stream in the stack | |
level | the compression level which must be in the range [0,9] | |
size | the size of the internal buffer |
- (id) initWithOutStream: | (OLOutStream *) | underStream | ||
compressionLevel: | (int) | level | ||
bufferSize: | (unsigned) | size | ||
writeZlibHeader: | (BOOL) | zlibHeader | ||
Initialize the compression stream.
The stream uses the given compression level and buffer size. The given out stream underStream is the next lower stream in the stream stack. If zlibHeader is YES, then the zlib header will be written to the stream, otherwise it will not be written.
NSInvalidArgumentException | if the compression level is not in the range [0,9] | |
OLInputOutputException | if the stream cannot be created for deflation |
underStream | the next lower stream in the stack | |
level | the compression level which must be in the range [0,9] | |
size | the size of the internal buffer | |
zlibHeader | should be YES if the zlib header should be written to the stream, otherwise NO |
Reimplemented in OLGzipOutStream.
+ (id) streamWithOutStream: | (OLOutStream *) | underStream |
Create and return a new compression stream.
The stream uses the default compression level and a buffer size of 1,024. The given out stream underStream is the next lower stream in the stream stack.
OLInputOutputException | if the stream cannot be created for deflation |
underStream | the next lower stream in the stack |
Reimplemented in OLGzipOutStream.
+ (id) streamWithOutStream: | (OLOutStream *) | underStream | ||
compressionLevel: | (int) | level | ||
Create and return a new compression stream.
The stream uses the given compression level and a buffer size of 1,024. The given out stream underStream is the next lower stream in the stream stack.
OLInvalidArgumentException | if the compression level is not in the range [0,9] | |
OLInputOutputException | if the stream cannot be created for deflation |
underStream | the next lower stream in the stack | |
level | the compression level which must be in the range [0,9] |
Reimplemented in OLGzipOutStream.
- (unsigned) writeBytes: | (const uint8_t *) | bytes | ||
count: | (unsigned) | num | ||
Write a sequence of bytes to the stream.
Compress up to num bytes and return the number actually written.
OLInputOutputException | if there is an error writing to the stream |
bytes | the bytes to write | |
num | the number of bytes to write |
Reimplemented from OLLayeredOutStream.
Reimplemented in OLGzipOutStream.
- (uint8_t*) buffer [protected] |
The buffer required by zlib.
- (unsigned) bufferSize [protected] |
The size of the zlib buffer.
- (BOOL) isFinished [protected] |
Indicator of whether the compression has finished yet.
- (struct z_stream_s*) zstream [protected] |
The opaque data type used by zlib to represent the stream.
|