OLLayeredInStream Class Reference
[Streams]

An in stream that is layered over another in stream. More...

#import <ObjectiveLib/LayeredInStream.h>

Inheritance diagram for OLLayeredInStream:

Inheritance graph
[legend]
List of all members.

Public Member Functions

(void) - close
 Close the stream.
(id) - connectedInStream
 Return the OLConnectedInStream at the bottom of the stream stack.
(void) - freeStreamResources
 Free the stream's resources.
(unsigned) - readBytes:count:
 Read a sequence of bytes from the stream.
Initializers and Deallocators
(id) - initWithInStream:
 Initialize the stream.

Protected Attributes

OLInStreamstream
 The stream on top of which this stream is layered.

Detailed Description

An in stream that is layered over another in stream.

Layered streams can filter data that are initially read from connected streams. The methods in OLLayeredInStream merely forward messages to the underlying in stream.

See also:
Streams


Member Function Documentation

- (void) close  

Close the stream.

After receiving this message the stream will no long be available for reading.

Exceptions:
OLInputOutputException if there is an error closing the stream

Reimplemented from OLInStream.

Reimplemented in OLBzlibInStream, and OLZlibInStream.

- (id) connectedInStream  

Return the OLConnectedInStream at the bottom of the stream stack.

All layered streams in this stack of layered streams will return the same value of the connected stream.

Note:
The returned value should not be released, as that will destroy the integrity of the stream stack. The returned object will be a type of OLConnectedInStream, but it is returned as an id to enable more freedom in calling its methods.
Returns:
the connected stream

- (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.

Note:
All sublcasses that allocate resources must implement this method to free those resources and call [super freeStreamResources].

Reimplemented from OLReferenceCountedStream.

Reimplemented in OLBufferingInStream, OLBzlibInStream, OLGzipInStream, OLObjectInStream, and OLZlibInStream.

- (id) initWithInStream: (OLInStream *)  underStream  

Initialize the stream.

Parameters:
underStream the stream that functions as the layer under this one
Returns:
a reference to this stream

Reimplemented in OLBufferingInStream, OLBzlibInStream, OLObjectInStream, and OLZlibInStream.

- (unsigned) readBytes: (uint8_t *)  buffer
count: (unsigned)  max 

Read a sequence of bytes from the stream.

This implementation merely forwards the message to the next stream down in the stream stack.

Exceptions:
OLInputOutputException if there is an error reading from the stream
Parameters:
buffer the address to which the bytes should be read
max the maximum number bytes that should be read
Returns:
the number of bytes read or UINT_MAX if no bytes could be read

Reimplemented from OLInStream.

Reimplemented in OLBufferingInStream, OLBzlibInStream, OLGzipInStream, and OLZlibInStream.


Member Data Documentation

- (OLInStream*) stream [protected]

The stream on top of which this stream is layered.


The documentation for this class was generated from the following file:
ObjectiveLibGenerated Sun Apr 22 15:18:44 2007, © 2004-2007 Will Mason
SourceForge.net Logo