CryptoStream.Write Method
.NET Framework 1.1
Writes a sequence of bytes to the current CryptoStream and advances the current position within this stream by the number of bytes written.
[Visual Basic] Overrides Public Sub Write( _ ByVal buffer() As Byte, _ ByVal offset As Integer, _ ByVal count As Integer _ ) [C#] public override void Write( byte[] buffer, int offset, int count ); [C++] public: void Write( unsigned char buffer __gc[], int offset, int count ); [JScript] public override function Write( buffer : Byte[], offset : int, count : int );
Parameters
- buffer
- An array of bytes. This method copies count bytes from buffer to the current stream.
- offset
- The byte offset in buffer at which to begin copying bytes to the current stream.
- count
- The number of bytes to be written to the current stream.
Exceptions
| Exception Type | Condition |
|---|---|
| NotSupportedException | The current stream is not writable. |
| ArgumentOutOfRangeException | The offset parameter is less than zero.
-or- The count parameter is less than zero. |
| ArgumentException | Thesum of the count and offset parameters is longer than the length of the buffer. |
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
CryptoStream Class | CryptoStream Members | System.Security.Cryptography Namespace | Cryptographic Services