Class PlainTextByLineStream

Namespace
NOpenNLP.Tools.Util
Assembly
NOpenNLP.Tools.dll

Reads a plain text file and return each line as a string object.

public class PlainTextByLineStream : ObjectStreamBase<string?>, IObjectStream<string?>, IDisposable
Inheritance
PlainTextByLineStream
Implements
Inherited Members

Constructors

PlainTextByLineStream(IInputStreamFactory, string)

public PlainTextByLineStream(IInputStreamFactory inputStreamFactory, string charsetName)

Parameters

inputStreamFactory IInputStreamFactory
charsetName string

PlainTextByLineStream(IInputStreamFactory, Encoding)

public PlainTextByLineStream(IInputStreamFactory inputStreamFactory, Encoding charset)

Parameters

inputStreamFactory IInputStreamFactory
charset Encoding

Methods

Dispose(bool)

Releases the resources from this object stream.

protected override void Dispose(bool disposing)

Parameters

disposing bool

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 string? Read()

Returns

string

the next object or null to signal that the stream is exhausted

Exceptions

IOException

if there is an error during reading

Reset()

Repositions the stream at the beginning and the previously seen object sequence will be repeated exactly. This method can be used to re-read the stream if multiple passes over the objects are required.

The implementation of this method is optional.

public override void Reset()

Exceptions

IOException

if there is an error during resetting the stream

NotSupportedException

if reset is not supported on this stream