NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Stream.WriteByte

Writes a byte to the current position in the stream.

If the stream is closed or not writable, an exception will be thrown.

[Visual Basic]
Overridable Public Sub WriteByte( _
   ByVal value As Byte _
)
[C#]
public virtual void WriteByte(
   byte value
);
[C++]
public: virtual void WriteByte(
   unsigned char value
);
[JScript]
public function WriteByte(
   value : Byte
);

Parameters

value
A byte to write to the stream.

Exceptions

Exception Type Condition
IOException The stream is closed.
NotSupportedException The stream does not support writing.

Remarks

While correct, the implementation on Stream creates a new one byte long array then calls Write(byte[], int, int). Any stream with an internal buffer should override this method and provide a much more efficient version that reads their buffer directly, avoiding the extra array allocation on every call.

See Also

Stream Class | Stream Members | System.IO Namespace