Class SignerSink
- Namespace
- Org.BouncyCastle.Crypto.IO
- Assembly
- BouncyCastle.Cryptography.dll
public sealed class SignerSink : BaseOutputStream, IAsyncDisposable, IDisposable
- Inheritance
-
SignerSink
- Implements
- Inherited Members
Constructors
SignerSink(ISigner)
public SignerSink(ISigner signer)
Parameters
signerISigner
Properties
Signer
public ISigner Signer { get; }
Property Value
Methods
Write(byte[], int, int)
When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
public override void Write(byte[] buffer, int offset, int count)
Parameters
bufferbyte[]An array of bytes. This method copies
countbytes frombufferto the current stream.offsetintThe zero-based byte offset in
bufferat which to begin copying bytes to the current stream.countintThe number of bytes to be written to the current stream.
Exceptions
- ArgumentException
The sum of
offsetandcountis greater than the buffer length.- ArgumentNullException
bufferis null.- ArgumentOutOfRangeException
offsetorcountis negative.- IOException
An I/O error occurred, such as the specified file cannot be found.
- NotSupportedException
The stream does not support writing.
- ObjectDisposedException
Write(byte[], int, int) was called after the stream was closed.
Write(ReadOnlySpan<byte>)
When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
public override void Write(ReadOnlySpan<byte> buffer)
Parameters
bufferReadOnlySpan<byte>A region of memory. This method copies the contents of this region to the current stream.
WriteAsync(byte[], int, int, CancellationToken)
Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Parameters
bufferbyte[]The buffer to write data from.
offsetintThe zero-based byte offset in
bufferfrom which to begin copying bytes to the stream.countintThe maximum number of bytes to write.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests. The default value is None.
Returns
- Task
A task that represents the asynchronous write operation.
Exceptions
- ArgumentNullException
bufferis null.- ArgumentOutOfRangeException
offsetorcountis negative.- ArgumentException
The sum of
offsetandcountis larger than the buffer length.- NotSupportedException
The stream does not support writing.
- ObjectDisposedException
The stream has been disposed.
- InvalidOperationException
The stream is currently in use by a previous write operation.
WriteAsync(ReadOnlyMemory<byte>, CancellationToken)
Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.
public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken = default)
Parameters
bufferReadOnlyMemory<byte>The region of memory to write data from.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests. The default value is None.
Returns
- ValueTask
A task that represents the asynchronous write operation.
WriteByte(byte)
Writes a byte to the current position in the stream and advances the position within the stream by one byte.
public override void WriteByte(byte value)
Parameters
valuebyteThe byte to write to the stream.
Exceptions
- IOException
An I/O error occurs.
- NotSupportedException
The stream does not support writing, or the stream is already closed.
- ObjectDisposedException
Methods were called after the stream was closed.