| Visual Basic (Declaration) | |
|---|---|
Public Overloads Function Read() As String | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As SegmentedStream Dim value As String value = instance.Read() | |
| C# | |
|---|---|
public string Read() | |
| Managed Extensions for C++ | |
|---|---|
public: string* Read(); | |
| C++/CLI | |
|---|---|
public: String^ Read(); | |
Return Value
A string containing the data read from the stream.| Exception | Description |
|---|---|
| System.IO.IOException | Thrown when the stream is not Readable. |
| System.ArgumentNullException | Thrown when the receiving buffer is null. |
| System.ArgumentOutOfRangeException | Thrown when the offset is less than zero or when count is less than or equal to zero. |
| System.ArgumentException | Thrown when (offset + count) > buffer.Length. |
This method will block (for ReceiveTimeout) until at least 1 byte is available for reading, or the connection is closed by the server, in which case an empty string is returned. The Charset property is used to convert from bytes to unicode characters, which allows unicode characters to be passed over the network.
Target Platforms: Microsoft .NET Framework 2.0