MemoryStream.WriteByte(Byte) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在當前位置寫入一個位元組。
public:
override void WriteByte(System::Byte value);
public override void WriteByte(byte value);
override this.WriteByte : byte -> unit
Public Overrides Sub WriteByte (value As Byte)
參數
- value
- Byte
要寫的位元。
例外狀況
目前的溪流已關閉。
範例
此程式碼範例是本類別更大範例 MemoryStream 的一部分。
// Write the second string to the stream, byte by byte.
count = 0;
while(count < secondString.Length)
{
memStream.WriteByte(secondString[count++]);
}
' Write the second string to the stream, byte by byte.
count = 0
While(count < secondString.Length)
memStream.WriteByte(secondString(count))
count += 1
End While
備註
這個方法會覆寫 WriteByte。
除了構造中帶有位元組[]參數外,將MemoryStream寫入在展開MemoryStream的末尾MemoryStream的操作。