MemoryStream.WriteByte(Byte) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Writes a byte to the current stream at the current position.
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)
Parameters
- value
- Byte
The byte to write.
Exceptions
The stream does not support writing. For additional information see CanWrite.
-or-
The current position is at the end of the stream, and the capacity cannot be modified.
The current stream is closed.
Examples
This code example is part of a larger example provided for the MemoryStream class.
// 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++]);
}
' Write the second string to the stream, byte by byte.
count = 0
While(count < secondString.Length)
memStream.WriteByte(secondString(count))
count += 1
End While
Remarks
This method overrides WriteByte.
Except for a MemoryStream
constructed with a byte[] parameter, write operations at the end of a MemoryStream
expand the MemoryStream
.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback을 참조하세요.
출시 예정: 2024년 내내 콘텐츠 피드백 메커니즘인 GitHub 문제를 단계적으로 폐지하고 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은다음에 대한 사용자 의견 제출 및 보기