PowerTCP Mail for .NET
Read(String,Int32,Boolean) Method
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > SegmentedStream Class > Read Method : Read(String,Int32,Boolean) Method




delimiter
The sequence to find.
maxLength
The maximum length of the string returned.
found
Will be set to true if sequence is found; false otherwise.
Read data from the stream until a delimiter is reached.

Syntax

Visual Basic (Declaration) 
Public Overloads Function Read( _
   ByVal delimiter As String, _
   ByVal maxLength As Integer, _
   ByRef found As Boolean _
) As String
Visual Basic (Usage)Copy Code
Dim instance As SegmentedStream
Dim delimiter As String
Dim maxLength As Integer
Dim found As Boolean
Dim value As String
 
value = instance.Read(delimiter, maxLength, found)
C# 
public string Read( 
   string delimiter,
   int maxLength,
   ref bool found
)
Managed Extensions for C++ 
public: string* Read( 
   string* delimiter,
   int maxLength,
   ref bool found
) 
C++/CLI 
public:
String^ Read( 
   String^ delimiter,
   int maxLength,
   bool% found
) 

Parameters

delimiter
The sequence to find.
maxLength
The maximum length of the string returned.
found
Will be set to true if sequence is found; false otherwise.

Return Value

A string representation of the bytes read.

Exceptions

ExceptionDescription
System.IO.IOExceptionThrown when the stream is not Readable.

Remarks

This method reads data from the stream until delimiter is found or the end of the stream is reached.

This method is useful for reading until a sequence of characters is found. A good example of this is receiving an email message when using the POP protocol. When sending a POP mail message, a POP server will delimit the end of the message with <CRLF>.<CRLF>. Using this method you could simply read the data until this sequence is found, at which point the method would return.

If the delimiter is found, found is true, otherwise found is false.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.