Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
QuicStream.cs
Go to the documentation of this file.
2using System.IO;
6
7namespace System.Net.Quic;
8
9public sealed class QuicStream : Stream
10{
11 private readonly QuicStreamProvider _provider;
12
13 public override bool CanSeek => false;
14
15 public override long Length
16 {
17 get
18 {
19 throw new NotSupportedException();
20 }
21 }
22
23 public override long Position
24 {
25 get
26 {
27 throw new NotSupportedException();
28 }
29 set
30 {
31 throw new NotSupportedException();
32 }
33 }
34
35 public long StreamId => _provider.StreamId;
36
37 public override bool CanRead => _provider.CanRead;
38
40
41 public override bool CanWrite => _provider.CanWrite;
42
43 public override bool CanTimeout => _provider.CanTimeout;
44
45 public override int ReadTimeout
46 {
47 get
48 {
50 }
51 set
52 {
53 _provider.ReadTimeout = value;
54 }
55 }
56
57 public override int WriteTimeout
58 {
59 get
60 {
62 }
63 set
64 {
65 _provider.WriteTimeout = value;
66 }
67 }
68
69 internal QuicStream(QuicStreamProvider provider)
70 {
71 _provider = provider;
72 }
73
74 public override long Seek(long offset, SeekOrigin origin)
75 {
76 throw new NotSupportedException();
77 }
78
79 public override void SetLength(long value)
80 {
81 throw new NotSupportedException();
82 }
83
84 public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
85 {
87 }
88
89 public override int EndRead(IAsyncResult asyncResult)
90 {
92 }
93
94 public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
95 {
97 }
98
103
104 public override int Read(byte[] buffer, int offset, int count)
105 {
107 return Read(buffer.AsSpan(offset, count));
108 }
109
115
116 public override void Write(byte[] buffer, int offset, int count)
117 {
119 Write(buffer.AsSpan(offset, count));
120 }
121
127
128 public override int Read(Span<byte> buffer)
129 {
130 return _provider.Read(buffer);
131 }
132
137
138 public override void Write(ReadOnlySpan<byte> buffer)
139 {
141 }
142
147
148 public override void Flush()
149 {
151 }
152
157
158 public void AbortRead(long errorCode)
159 {
160 _provider.AbortRead(errorCode);
161 }
162
163 public void AbortWrite(long errorCode)
164 {
165 _provider.AbortWrite(errorCode);
166 }
167
172
177
182
187
192
197
202
203 public void Shutdown()
204 {
206 }
207
208 protected override void Dispose(bool disposing)
209 {
210 if (disposing)
211 {
213 }
214 }
215}
static void ValidateBufferArguments(byte[] buffer, int offset, int count)
Definition Stream.cs:1044
ValueTask ShutdownCompleted(CancellationToken cancellationToken=default(CancellationToken))
ValueTask WaitForWriteCompletionAsync(CancellationToken cancellationToken=default(CancellationToken))
void Write(ReadOnlySpan< byte > buffer)
ValueTask WriteAsync(ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
Task FlushAsync(CancellationToken cancellationToken)
ValueTask< int > ReadAsync(Memory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
override void Write(byte[] buffer, int offset, int count)
override Task FlushAsync(CancellationToken cancellationToken)
override void Dispose(bool disposing)
ValueTask WriteAsync(ReadOnlySequence< byte > buffers, bool endStream, CancellationToken cancellationToken=default(CancellationToken))
override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
readonly QuicStreamProvider _provider
Definition QuicStream.cs:11
override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
Definition QuicStream.cs:84
override long Seek(long offset, SeekOrigin origin)
Definition QuicStream.cs:74
override int Read(Span< byte > buffer)
override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
Definition QuicStream.cs:94
override Task< int > ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
override int EndRead(IAsyncResult asyncResult)
Definition QuicStream.cs:89
void AbortWrite(long errorCode)
ValueTask WriteAsync(ReadOnlyMemory< ReadOnlyMemory< byte > > buffers, CancellationToken cancellationToken=default(CancellationToken))
ValueTask WriteAsync(ReadOnlyMemory< byte > buffer, bool endStream, CancellationToken cancellationToken=default(CancellationToken))
override void EndWrite(IAsyncResult asyncResult)
Definition QuicStream.cs:99
override void SetLength(long value)
Definition QuicStream.cs:79
void AbortRead(long errorCode)
override ValueTask< int > ReadAsync(Memory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
ValueTask WriteAsync(ReadOnlySequence< byte > buffers, CancellationToken cancellationToken=default(CancellationToken))
override int Read(byte[] buffer, int offset, int count)
ValueTask WriteAsync(ReadOnlyMemory< ReadOnlyMemory< byte > > buffers, bool endStream, CancellationToken cancellationToken=default(CancellationToken))
ValueTask ShutdownCompleted(CancellationToken cancellationToken=default(CancellationToken))
override void Write(ReadOnlySpan< byte > buffer)
QuicStream(QuicStreamProvider provider)
Definition QuicStream.cs:69
ValueTask WaitForWriteCompletionAsync(CancellationToken cancellationToken=default(CancellationToken))
override ValueTask WriteAsync(ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
static IAsyncResult Begin(Task task, AsyncCallback callback, object state)
Definition TaskToApm.cs:43
static void End(IAsyncResult asyncResult)
Definition TaskToApm.cs:48