Export (0) Print
Expand All

UnmanagedMemoryStream.Position Property

Gets or sets the current position in a stream.

This property is not CLS-compliant.  

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)

public override long Position { get; set; }
/** @property */
public long get_Position ()

/** @property */
public void set_Position (long value)

public override function get Position () : long

public override function set Position (value : long)

Not applicable.

Property Value

The current position in the stream.

Exception typeCondition

ObjectDisposedException

The stream is closed.

ArgumentOutOfRangeException

The position is set to a value that is less than zero, or the position is larger than MaxValue or results in overflow when added to the current pointer.

When a stream is initialized, this property is set to zero.

Although you can set the position of the stream beyond the stream's capacity, you will not be able to access that area using the Read and Write methods. Read will return 0 and Write will throw a NotSupportedException. This support is primarily for design and code compatibility with basic stream operations.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft