Stream. Set Length(Int64) 方法
设置缓冲流的长度。Sets the length of the buffered stream.
public: override void SetLength(long value);
public override void SetLength (long value);
override this.SetLength : int64 -> unit
Public Overrides Sub SetLength (value As Long)
一个整数，指示当前缓冲流的所需长度（以字节为单位）。An integer indicating the desired length of the current buffered stream in bytes.
value is negative.
null。The stream is not open or is
该流不支持写入和查找。The stream does not support both writing and seeking.
在流关闭后调用方法。Methods were called after the stream was closed.
在设置基础数据源或存储库的长度之前，将刷新缓冲区。The buffer is flushed before setting the length of the underlying data source or repository. 如果指定的值小于缓冲流的当前长度，则将截断缓冲流。If the specified value is less than the current length of the buffered stream, the buffered stream is truncated. 如果指定的值大于缓冲流的当前长度，则将展开缓冲流。If the specified value is larger than the current length of the buffered stream, the buffered stream is expanded. 如果缓冲流已展开，则不会定义旧长度与新长度之间缓冲流的内容。If the buffered stream is expanded, the contents of the buffered stream between the old and the new lengths are not defined.
SetLength flushes any buffered writes if necessary.
SetLength 才能工作。A stream must support both writing and seeking for
SetLength to work.