Module: Advanced Tools Package: Streams
RWSynchronizedByteInputStreamImp RWTInputStreamLockImp<RWByteInputStream, RWFilteredByteInputStreamImp>
#include <rw/stream/RWSynchronizedByteInputStreamImp.h>
Class RWSynchronizedByteInputStreamImp implements a simple lock stream that is used with binary input stream. The stream locks its internal synchronization mechanism before forwarding input requests to its associated source stream, and then unlocks the internal synchronization mechanism upon completion. The stream's internal synchronization mechanism is locked using a guard object, ensuring its proper release in the event that an exception is thrown.
RWSynchronizedByteInputStreamImp(RWByteInputStream&
sourceStream);
Initializes the reference to the input stream that will be used as the source of bytes.
Parameter List
sourceStream |
The input stream that will serve as the source of bytes. |
static RWByteInputStream make(RWByteInputStream& sourceStream);
Constructs an RWSynchronizedByteInputStreamImp instance that uses sourceStream as the source of bytes, and returns a handle to it. Throws no exceptions.
Parameter List
sourceStream |
The output stream that will serve as the source of bytes. |
virtual RWSize readUntil(RWByte* byteArray, RWSize maxSize, RWByte delim);
Reads bytes from the stream until the last byte read is equal to delim, or maxSize bytes have been read, or the end of the input sequence is reached. The bytes read are stored in byteArray. The function returns the actual number of bytes read from the stream.
Parameter List
byteArray |
A pointer to the array receiving the bytes extracted from the stream. |
maxSize |
The maximum number of bytes to be read. |
delim |
The byte value used as a delimiter. |
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.