- Jim Croce
TextStream
TextStream Methods
TextStream() | Constructor for the TextStream class using an associated stream |
ReadRecord() | Reads a single text record from the associated stream |
WriteRecord() | Writes a single text record to the associated stream |
Derived Classes
None
See Also
Class Hierarchy, FileStream, MemoryStream, SocketStream, StreamException
public method TextStream(StreamIO AssociatedStream)
Parameters
AssociatedStream
Stream object associated with this filter stream
Return Value
None
Description
Constructor for the TextStream class. The associated stream is passed in. All read and write operations performed on this filter stream will be performed against the associated stream.
TextStream Class
public method<string> ReadRecord(bool PeekOnly = false)
Parameters
PeekOnly
If true, read without advancing pointer
Return Value
Returns the next text record
Description
This method reads the next text record from the associated stream. It reads characters until an LF character is reached, or a CR/LF combination. It stops reading at that point and returns the single text record preceding the line feed. It also supports the standard "PeekOnly" flag.
If the "associated stream" is specified as "Write", this method will fire a StreamException.
TextStream Class
public method WriteRecord(string TextRecord, bool UseCR = true)
Parameters
TextRecord
Text string to be written
Return Value
None
Description
This method writes a single text string to the associated stream as an ASCII "record". It writes the text string to the stream, followed by a line feed character. If the "UseCR" flag is true, it also places a carriage return character before the line feed (CR/LF versus LF).
If the "associated stream" is specified as "Read", this method will fire a StreamException.
TextStream Class