IsolatedStorageFileStream.SetLength(Int64) 方法

定义

将此 IsolatedStorageFileStream 对象的长度设置为指定的 valueSets the length of this IsolatedStorageFileStream object to the specified value.

public:
 override void SetLength(long value);
public override void SetLength (long value);
override this.SetLength : int64 -> unit
Public Overrides Sub SetLength (value As Long)

参数

value
Int64

IsolatedStorageFileStream 对象的新长度。The new length of the IsolatedStorageFileStream object.

异常

value 为负数。value is a negative number.

注解

如果指定的 value 小于 IsolatedStorageFileStream 对象的当前长度,则流将被截断。If the specified value is less than the current length of the IsolatedStorageFileStream object, the stream is truncated. 如果指定的 value 大于流的当前长度,则会扩展流。If the specified value is larger than the current length of the stream, the stream is expanded. 如果流已展开,则新旧长度之间的流内容不确定。If the stream is expanded, the contents of the stream between the old and the new length are undefined. 为了使用此方法,IsolatedStorageFileStream 对象必须支持写入和查找。In order to use this method, an IsolatedStorageFileStream object must support both writing and seeking.

适用于