#import <ObjectiveLib/ObjectInStream.h>
Inheritance diagram for OLObjectInStream:
Public Member Functions | |
(unsigned) | - classVersion: |
Return the version of the given class name. | |
(void) | - freeStreamResources |
Free the stream's resources. | |
(BOOL) | - readBool |
Read a boolean value from the stream. | |
(Class) | - readClass |
Read a class. | |
(double) | - readDouble |
Read a double value from the stream. | |
(float) | - readFloat |
Read a float value from the stream. | |
(void) | - readHeader |
Read the object stream header. | |
(unsigned) | - readInt |
Read an integer value from the stream. | |
(uint16_t) | - readInt16 |
Read a 16-bit integer value from the stream. | |
(uint32_t) | - readInt32 |
Read a 32-bit integer value from the stream. | |
(uint64_t) | - readInt64 |
Read a 64-bit integer value from the stream. | |
(id) | - readObject |
Read an object. | |
(unsigned) | - systemVersion |
Return the version of the system stored in the stream. | |
Initializers and Deallocators | |
(id) | - initWithInStream: |
Initialize the stream. | |
Static Public Member Functions | |
(id) | + streamWithInStream: |
Create and return a new object in stream. | |
Protected Attributes | |
OLHashMap * | classes |
The classes read by the stream. | |
OLSharedPointerTable * | sharedPointers |
The shared pointers read by the stream. | |
uint32_t | systemVersion |
The system version read by the stream. |
In addition to reading objects and classes OLObjectInStream reads a tag of every type that OLObjectOutStream has written to the stream. If a certain type is expected but another type is found, then an exception is thrown indicating the inconsistency.
- (unsigned) classVersion: | (const char *) | className |
Return the version of the given class name.
If the class has been read with the readClass method, then the version of the class will be returned.
className | the name of the class that should be queried |
- (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 OLLayeredInStream.
- (id) initWithInStream: | (OLInStream *) | underStream |
Initialize the stream.
The stream is created with underStream as the next stream below the new one in the stack of streams.
underStream | the stream from which to read |
Reimplemented from OLLayeredInStream.
- (BOOL) readBool |
Read a boolean value from the stream.
The value is read as if it had been written by writeBool: (OLOutStream). Specifically, one byte of data is read and YES is returned if that byte is non-zero, otherwise NO is returned.
OLInputOutputException | if the value could not be read | |
OLEndOfStreamException | if the end of the stream has been reached |
Reimplemented from OLInStream.
- (Class) readClass |
Read a class.
A class previously written by writeClass: (OLObjectOutStream) is read.
OLInputOutputException | if there is an error reading from the stream | |
OLClassNotFoundException | if the class stored in the stream is not available in the current runtime |
- (double) readDouble |
Read a double value from the stream.
The value is read as if it had been written by writeDouble: (OLOutStream). Specifically, an 8-byte field of data is read and converted from network byte order to host byte order.
OLInputOutputException | if the value could not be read | |
OLEndOfStreamException | if the end of the stream has been reached |
Reimplemented from OLInStream.
- (float) readFloat |
Read a float value from the stream.
The value is read as if it had been written by writeFloat: (OLOutStream). Specifically, an 4-byte field of data is read and converted from network byte order to host byte order.
OLInputOutputException | if the value could not be read | |
OLEndOfStreamException | if the end of the stream has been reached |
Reimplemented from OLInStream.
- (void) readHeader |
Read the object stream header.
This method can be overridden to read a custom header from the object stream. The message will be called in due course, so it is never necessary to call this method.
OLInputOutputException | if there is an error reading from the stream |
- (unsigned) readInt |
Read an integer value from the stream.
The value is read as if it had been written by writeInt: (OLOutStream). Specifically, an 4-byte field of data is read and converted from network byte order to host byte order.
int
on the platform being used, the value read will always be exactly four bytes long and returned as an unsigned
value.OLInputOutputException | if the value could not be read | |
OLEndOfStreamException | if the end of the stream has been reached |
Reimplemented from OLInStream.
- (uint16_t) readInt16 |
Read a 16-bit integer value from the stream.
The value is read as if it had been written by writeInt16: (OLOutStream). Specifically, an 2-byte field of data is read and converted from network byte order to host byte order.
OLInputOutputException | if the value could not be read | |
OLEndOfStreamException | if the end of the stream has been reached |
Reimplemented from OLInStream.
- (uint32_t) readInt32 |
Read a 32-bit integer value from the stream.
The value is read as if it had been written by writeInt32: (OLOutStream). Specifically, an 4-byte field of data is read and converted from network byte order to host byte order.
OLInputOutputException | if the value could not be read | |
OLEndOfStreamException | if the end of the stream has been reached |
Reimplemented from OLInStream.
- (uint64_t) readInt64 |
Read a 64-bit integer value from the stream.
The value is read as if it had been written by writeInt64: (OLOutStream). Specifically, an 8-byte field of data is read and converted from network byte order to host byte order.
OLInputOutputException | if the value could not be read | |
OLEndOfStreamException | if the end of the stream has been reached |
Reimplemented from OLInStream.
- (id) readObject |
Read an object.
An object previously written by writeObject: (OLObjectOutStream) is read.
OLInputOutputException | if there is an error reading from the stream | |
OLClassNotFoundException | if a class on which instantiating the object depends cannot be found in the current runtime |
+ (id) streamWithInStream: | (OLInStream *) | underStream |
Create and return a new object in stream.
The stream is created with underStream as the next stream below the new one in the stack of streams.
underStream | the stream from which to read |
- (unsigned) systemVersion |
Return the version of the system stored in the stream.
The version of the ObjectiveLib streaming system that is stored in the stream is returned.
- (OLSharedPointerTable*) sharedPointers [protected] |
The shared pointers read by the stream.
- (uint32_t) systemVersion [protected] |
The system version read by the stream.
|