#import <ObjectiveLib/BzlibOutStream.h>
Inheritance diagram for OLBzlibOutStream:
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:blockSize: |
Initialize the compression stream. | |
(id) | - initWithOutStream:blockSize:bufferSize: |
Initialize the compression stream. | |
Static Public Member Functions | |
(id) | + streamWithOutStream: |
Create and return a new compression stream. | |
(id) | + streamWithOutStream:blockSize: |
Create and return a new compression stream. | |
Protected Attributes | |
uint8_t * | buffer |
The buffer required by bzlib. | |
unsigned | bufferSize |
The size of the zlib buffer. | |
void * | bzstream |
The opaque data type used by bzlib to represent the stream. |
This is a concrete layered stream that compresses all data written using the library bzlib. The bzlib library is very similar to the zlib compression library, except that it compresses much better and usually more slowly than zlib.
bzip2
.
- (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.
- (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.
- (id) initWithOutStream: | (OLOutStream *) | underStream |
Initialize the compression stream.
The stream uses a block size of 9 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 compression |
underStream | the next lower stream in the stack |
Reimplemented from OLLayeredOutStream.
- (id) initWithOutStream: | (OLOutStream *) | underStream | ||
blockSize: | (int) | block | ||
Initialize the compression stream.
The stream uses the given block size 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 compression |
underStream | the next lower stream in the stack | |
block | the block size which must be in the range [1,9] |
- (id) initWithOutStream: | (OLOutStream *) | underStream | ||
blockSize: | (int) | block | ||
bufferSize: | (unsigned) | size | ||
Initialize the compression stream.
The stream uses the given block size and buffer size. The given out stream underStream is the next lower stream in the stream stack.
OLInputOutputException | if the stream cannot be created for compression |
underStream | the next lower stream in the stack | |
block | the block size which must be in the range [1,9] | |
size | the buffer size |
+ (id) streamWithOutStream: | (OLOutStream *) | underStream |
Create and return a new compression stream.
The stream uses a block size of 9 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 compression |
underStream | the next lower stream in the stack |
+ (id) streamWithOutStream: | (OLOutStream *) | underStream | ||
blockSize: | (int) | block | ||
Create and return a new compression stream.
The stream uses the given block size and a buffer size of 1,024. The given out stream underStream is the next lower stream in the stream stack.
OLInvalidArgumentException | if the block size is not in the range [1,9] | |
OLInputOutputException | if the stream cannot be created for compression |
underStream | the next lower stream in the stack | |
block | the block size which must be in the range [1,9] |
- (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.
- (uint8_t*) buffer [protected] |
The buffer required by bzlib.
- (unsigned) bufferSize [protected] |
The size of the zlib buffer.
- (void*) bzstream [protected] |
The opaque data type used by bzlib to represent the stream.
|