#include <ZStreamR_Boundary.h>
Inheritance diagram for ZStreamR_Boundary:
Public Member Functions | |
virtual size_t | Imp_CountReadable () |
Returns the number of bytes guaranteed to be readable without blocking. | |
bool | HitBoundary () const |
void | Reset () |
We use Boyer-Moore to efficiently search for the boundary sequence in the source stream. However, instead of discarding data that fails to match it is returned as the result of calls to Imp_Read.
size_t ZStreamR_Boundary::Imp_CountReadable | ( | ) | [virtual] |
Returns the number of bytes guaranteed to be readable without blocking.
If the stream does not or cannot know this information it should return zero. A zero return thus does not mean no data is available, simply that a subsequent Read or Skip may block indefinitely.
Reimplemented from ZStreamR.
bool ZStreamR_Boundary::HitBoundary | ( | ) | const |
This method distinguishes between a stream that's gone empty because the boundary was encountered and one that's gone empty because the source stream is empty.
void ZStreamR_Boundary::Reset | ( | ) |
After the boundary has been encountered the stream appears empty. Calling ZStreamR_Boundary::Reset will allow data to be read again until the next boundary or the real end of stream.