Export (0) Print
Expand All

BufferedStream.Length Property

Gets the stream length in bytes.

[Visual Basic]
Overrides Public ReadOnly Property Length As Long
[C#]
public override long Length {get;}
[C++]
public: __property __int64 get_Length();
[JScript]
public override function get Length() : long;

Property Value

The stream length in bytes.

Exceptions

Exception Type Condition
IOException The underlying stream is null or closed.
NotSupportedException The stream does not support seeking.
ObjectDisposedException Methods were called after the stream was closed.

Remarks

For an example of creating a file and writing text to a file, see Writing Text to a File. For an example of reading text from a file, see Reading Text from a File. For an example of reading from and writing to a binary file, see Reading and Writing to a Newly Created Data File.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

BufferedStream Class | BufferedStream Members | System.IO Namespace | Working with I/O | Reading Text from a File | Writing Text to a File

Show:
© 2015 Microsoft