| 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) | |
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.| Exception | Description |
|---|---|
| System.IO.IOException | Thrown when the stream is not Readable. |
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.
Target Platforms: Microsoft .NET Framework 2.0