Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

BufferedStream Constructor

.NET Framework 1.1

Initializes a new instance of the BufferedStream class.

Overload List

Initializes a new instance of the BufferedStream class with a default buffer size of 4096 bytes.

[Visual Basic] Public Sub New(Stream)
[C#] public BufferedStream(Stream);
[C++] public: BufferedStream(Stream*);
[JScript] public function BufferedStream(Stream);

Initializes a new instance of the BufferedStream class with the specified buffer size.

[Visual Basic] Public Sub New(Stream, Integer)
[C#] public BufferedStream(Stream, int);
[C++] public: BufferedStream(Stream*, int);
[JScript] public function BufferedStream(Stream, int);

Example

[Visual Basic, C#, C++] This code example is part of a larger example provided for the BufferedStream class.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of the BufferedStream constructor. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
' Create a NetworkStream that owns clientSocket and then 
' create a BufferedStream on top of the NetworkStream.
Dim netStream As New NetworkStream(clientSocket, True)
Dim bufStream As New _
    BufferedStream(netStream, streamBufferSize)

[C#] 
// Create a NetworkStream that owns clientSocket and 
// then create a BufferedStream on top of the NetworkStream.
// Both streams are disposed when execution exits the
// using statement.
using(Stream 
    netStream = new NetworkStream(clientSocket, true),
    bufStream = 
          new BufferedStream(netStream, streamBufferSize))

[C++] 
// Create a NetworkStream that owns clientSocket and 
// then create a BufferedStream on top of the NetworkStream.
NetworkStream* netStream = new NetworkStream(clientSocket, true);
BufferedStream* bufStream = 
    new BufferedStream(netStream, streamBufferSize);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

BufferedStream Class | BufferedStream Members | System.IO Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.