Writes a block of bytes to the current stream using data read from a buffer.
命名空间:
HslCommunication
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static void Write(
this MemoryStream ms,
byte[] buffer
)
<ExtensionAttribute>
Public Shared Sub Write (
ms As MemoryStream,
buffer As Byte()
)
public:
[ExtensionAttribute]
static void Write(
MemoryStream^ ms,
array<unsigned char>^ buffer
)
[<ExtensionAttribute>]
static member Write :
ms : MemoryStream *
buffer : byte[] -> unit
参数
- ms
- 类型:System.IOMemoryStream
[缺少 "M:HslCommunication.HslExtension.Write(System.IO.MemoryStream,System.Byte[])" 的 <param name="ms"/> 文档]
- buffer
- 类型:SystemByte
The buffer to write data from.
备注
在 Visual Basic 和 C# 中,这个方法可以当成为类型
MemoryStream 的实例方法来调用。在采用实例方法语法调用这个方法时,请省略第一个参数。请参考
扩展方法 (Visual Basic) 或
扩展方法 (C# 编程指南) 获取更多信息。
异常 异常 | 条件 |
---|
ArgumentNullException | buffer is . |
NotSupportedException | The stream does not support writing. For additional information see CanWrite.
-or-
The current position is closer than count bytes to the end of the stream, and the capacity cannot be modified. |
ArgumentException | offset subtracted from the buffer length is less than count. |
ArgumentOutOfRangeException | offset or count are negative. |
IOException | An I/O error occurs. |
ObjectDisposedException | The current stream instance is closed. |
参见