}
[MethodImpl(MethodImplOptions.Synchronized)]
- public override ValueTask DisposeAsync()
- {
- return _out.DisposeAsync();
- }
-
- [MethodImpl(MethodImplOptions.Synchronized)]
public override void Flush() => _out.Flush();
[MethodImpl(MethodImplOptions.Synchronized)]
public override void Write(char[] buffer, int index, int count) => _out.Write(buffer, index, count);
[MethodImpl(MethodImplOptions.Synchronized)]
+ public override void Write(ReadOnlySpan<char> buffer) => _out.Write(buffer);
+
+ [MethodImpl(MethodImplOptions.Synchronized)]
public override void Write(bool value) => _out.Write(value);
[MethodImpl(MethodImplOptions.Synchronized)]
public override void WriteLine(char[] buffer, int index, int count) => _out.WriteLine(buffer, index, count);
[MethodImpl(MethodImplOptions.Synchronized)]
+ public override void WriteLine(ReadOnlySpan<char> buffer) => _out.WriteLine(buffer);
+
+ [MethodImpl(MethodImplOptions.Synchronized)]
public override void WriteLine(bool value) => _out.WriteLine(value);
[MethodImpl(MethodImplOptions.Synchronized)]
//
[MethodImpl(MethodImplOptions.Synchronized)]
+ public override ValueTask DisposeAsync()
+ {
+ Dispose();
+ return default;
+ }
+
+ [MethodImpl(MethodImplOptions.Synchronized)]
public override Task WriteAsync(char value)
{
Write(value);
[MethodImpl(MethodImplOptions.Synchronized)]
public override Task WriteAsync(StringBuilder value, CancellationToken cancellationToken = default)
{
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return Task.FromCanceled(cancellationToken);
+ }
+
Write(value);
return Task.CompletedTask;
}
}
[MethodImpl(MethodImplOptions.Synchronized)]
+ public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default)
+ {
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return Task.FromCanceled(cancellationToken);
+ }
+
+ Write(buffer.Span);
+ return Task.CompletedTask;
+ }
+
+ [MethodImpl(MethodImplOptions.Synchronized)]
+ public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default)
+ {
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return Task.FromCanceled(cancellationToken);
+ }
+
+ WriteLine(buffer.Span);
+ return Task.CompletedTask;
+ }
+
+ [MethodImpl(MethodImplOptions.Synchronized)]
public override Task WriteLineAsync(char value)
{
WriteLine(value);
}
[MethodImpl(MethodImplOptions.Synchronized)]
+ public override Task WriteLineAsync()
+ {
+ WriteLine();
+ return Task.CompletedTask;
+ }
+
+ [MethodImpl(MethodImplOptions.Synchronized)]
public override Task WriteLineAsync(string value)
{
WriteLine(value);
[MethodImpl(MethodImplOptions.Synchronized)]
public override Task WriteLineAsync(StringBuilder value, CancellationToken cancellationToken = default)
{
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return Task.FromCanceled(cancellationToken);
+ }
+
WriteLine(value);
return Task.CompletedTask;
}