Class SegmenterObjectStream<S, T>
An IObjectStream<T> which splits each incoming sample into zero or more outgoing samples, emitting them one at a time.
public abstract class SegmenterObjectStream<S, T> : FilterObjectStream<S?, T?>, IObjectStream<T?>, IDisposable where S : class where T : class
Type Parameters
Sthe type of the source/input stream
Tthe type of this stream
- Inheritance
-
FilterObjectStream<S, T>SegmenterObjectStream<S, T>
- Implements
- Derived
- Inherited Members
Constructors
SegmenterObjectStream(IObjectStream<S?>)
An IObjectStream<T> which splits each incoming sample into zero or more outgoing samples, emitting them one at a time.
protected SegmenterObjectStream(IObjectStream<S?> @in)
Parameters
inIObjectStream<S>
Methods
Dispose(bool)
Releases the resources from this object stream.
protected override void Dispose(bool disposing)
Parameters
disposingbool
Read()
Returns the next object. Calling this method repeatedly until it returns
null will return each object from the underlying source exactly once.
public override sealed T? Read()
Returns
- T
the next object or
nullto signal that the stream is exhausted
Exceptions
- IOException
if there is an error during reading
- IOException
if there is an error during reading
Read(S)
Splits the given sample into the samples this stream emits.
protected abstract IList<T>? Read(S sample)
Parameters
sampleSthe incoming sample to segment
Returns
- IList<T>
the outgoing samples, or
nullif the sample produced none
Exceptions
- IOException
if there is an error during reading