Writes a byte to the current position in the file stream.
Assembly: mscorlib (in mscorlib.dll)
This method overrides WriteByte.
Use WriteByte to write a byte to a FileStream efficiently. If the stream is closed or not writable, an exception will be thrown.
The default implementation on Stream creates a new single-byte array and then calls Write. While this is formally correct, it is inefficient. Any stream with an internal buffer should override this method and provide a much more efficient version that reads the buffer directly, avoiding the extra array allocation on every call.
For a list of common file and directory operations, see Common I/O Tasks.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)