terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
StreamWriter.cs
Go to the documentation of this file.
1using System;
2using System.Text;
5
6namespace System.IO
7{
8 // Token: 0x02000541 RID: 1345
10 public class StreamWriter : TextWriter
11 {
12 // Token: 0x060027B3 RID: 10163 RVA: 0x0005635C File Offset: 0x0005455C
14 {
15 bool isCompleted = this._asyncWriteTask.IsCompleted;
16 }
17
18 // Token: 0x060027B4 RID: 10164 RVA: 0x0000207A File Offset: 0x0000027A
19 private static void ThrowAsyncIOInProgress()
20 {
21 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
22 }
23
24 // Token: 0x170005B5 RID: 1461
25 // (get) Token: 0x060027B5 RID: 10165 RVA: 0x0005637C File Offset: 0x0005457C
26 private static Encoding UTF8NoBOM
27 {
28 get
29 {
30 if (!true)
31 {
32 }
34 }
35 }
36
37 // Token: 0x060027B6 RID: 10166 RVA: 0x00056394 File Offset: 0x00054594
38 internal StreamWriter()
39 {
40 if (!true)
41 {
42 }
43 if (!true)
44 {
45 }
46 if (!true)
47 {
48 }
49 }
50
51 // Token: 0x060027B7 RID: 10167 RVA: 0x000563AC File Offset: 0x000545AC
52 public StreamWriter(Stream stream)
53 {
54 if (!true)
55 {
56 }
58 }
59
60 // Token: 0x060027B8 RID: 10168 RVA: 0x000563C4 File Offset: 0x000545C4
61 public StreamWriter(Stream stream, Encoding encoding)
62 {
63 }
64
65 // Token: 0x060027B9 RID: 10169 RVA: 0x000563D4 File Offset: 0x000545D4
66 public StreamWriter(Stream stream, Encoding encoding, int bufferSize)
67 {
68 }
69
70 // Token: 0x060027BA RID: 10170 RVA: 0x000563E4 File Offset: 0x000545E4
71 public StreamWriter(Stream stream, Encoding encoding, int bufferSize, bool leaveOpen)
72 {
73 if (!true)
74 {
75 }
76 if (!true)
77 {
78 }
80 if (!true)
81 {
82 }
83 if (encoding != null && stream != null)
84 {
85 this.Init(stream, encoding, bufferSize, leaveOpen);
86 return;
87 }
88 }
89
90 // Token: 0x060027BB RID: 10171 RVA: 0x00056414 File Offset: 0x00054614
91 public StreamWriter(string path)
92 {
93 if (!true)
94 {
95 }
97 }
98
99 // Token: 0x060027BC RID: 10172 RVA: 0x0005642C File Offset: 0x0005462C
100 public StreamWriter(string path, bool append)
101 {
102 if (!true)
103 {
104 }
106 }
107
108 // Token: 0x060027BD RID: 10173 RVA: 0x00056444 File Offset: 0x00054644
109 public StreamWriter(string path, bool append, Encoding encoding, int bufferSize)
110 {
111 if (!true)
112 {
113 }
114 base..ctor();
115 if (path == null)
116 {
117 return;
118 }
119 if (encoding == null)
120 {
121 return;
122 }
123 if (path._stringLength != 0)
124 {
125 return;
126 }
127 }
128
129 // Token: 0x060027BE RID: 10174 RVA: 0x0005646C File Offset: 0x0005466C
130 private void Init(Stream streamArg, Encoding encodingArg, int bufferSize, bool shouldLeaveOpen)
131 {
135 Encoding encoding = this._encoding;
136 Stream stream = this._stream;
137 this._charLen = bufferSize;
138 Stream stream2 = this._stream;
140 this._closable = true;
141 }
142
143 // Token: 0x060027BF RID: 10175 RVA: 0x000564B8 File Offset: 0x000546B8
144 public override void Close()
145 {
146 GC.SuppressFinalize(this);
147 }
148
149 // Token: 0x060027C0 RID: 10176 RVA: 0x000564CC File Offset: 0x000546CC
150 protected override void Dispose(bool disposing)
151 {
152 if (this._stream != null)
153 {
155 this.Flush(true, true);
156 }
157 }
158
159 // Token: 0x060027C1 RID: 10177 RVA: 0x000564F0 File Offset: 0x000546F0
160 public override void Flush()
161 {
163 this.Flush(true, true);
164 }
165
166 // Token: 0x060027C2 RID: 10178 RVA: 0x0005650C File Offset: 0x0005470C
167 private void Flush(bool flushStream, bool flushEncoder)
168 {
169 while (this._stream == null)
170 {
171 }
172 if (this._charPos == 0)
173 {
174 }
175 if (!this._haveWrittenPreamble)
176 {
177 Encoding encoding = this._encoding;
179 Stream stream = this._stream;
180 }
181 Encoder encoder = this._encoder;
182 byte[] byteBuffer = this._byteBuffer;
183 char[] charBuffer = this._charBuffer;
184 int charPos = this._charPos;
185 Stream stream2 = this._stream;
186 byte[] byteBuffer2 = this._byteBuffer;
187 Stream stream3 = this._stream;
188 }
189
190 // Token: 0x170005B6 RID: 1462
191 // (set) Token: 0x060027C3 RID: 10179 RVA: 0x00056580 File Offset: 0x00054780
192 public virtual bool AutoFlush
193 {
194 set
195 {
197 long num = 0L;
198 this.Flush(true, num != 0L);
199 }
200 }
201
202 // Token: 0x170005B7 RID: 1463
203 // (get) Token: 0x060027C4 RID: 10180 RVA: 0x000565A0 File Offset: 0x000547A0
204 internal bool LeaveOpen
205 {
206 get
207 {
208 /*
209An exception occurred when decompiling this method (060027C4)
210
211ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean System.IO.StreamWriter::get_LeaveOpen()
212
213 ---> System.Exception: Basic block has to end with unconditional control flow.
214{
215 Block_0:
216 stloc:bool(var_0_06, ldfld:bool(StreamWriter::_closable, ldloc:StreamWriter(this)))
217}
218
219 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
220 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
221 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
222 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
223 --- End of inner exception stack trace ---
224 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
225 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
226*/;
227 }
228 }
229
230 // Token: 0x170005B8 RID: 1464
231 // (get) Token: 0x060027C5 RID: 10181 RVA: 0x000565B4 File Offset: 0x000547B4
232 public override Encoding Encoding
233 {
234 get
235 {
236 return this._encoding;
237 }
238 }
239
240 // Token: 0x060027C6 RID: 10182 RVA: 0x000565C8 File Offset: 0x000547C8
241 public override void Write(char value)
242 {
244 int charPos = this._charPos;
245 bool autoFlush = this._autoFlush;
246 long num = 0L;
247 long num2 = 0L;
248 this.Flush(num != 0L, num2 != 0L);
249 int charPos2 = this._charPos;
250 char[] charBuffer = this._charBuffer;
251 bool autoFlush2 = this._autoFlush;
253 if (autoFlush2)
254 {
255 int num3 = 1;
256 long num4 = 0L;
257 this.Flush(num3 != 0, num4 != 0L);
258 return;
259 }
260 }
261
262 // Token: 0x060027C7 RID: 10183 RVA: 0x0005662C File Offset: 0x0005482C
263 public override void Write(char[] buffer)
264 {
266 int charPos = this._charPos;
267 bool autoFlush = this._autoFlush;
268 char[] charBuffer = this._charBuffer;
269 int charPos2 = this._charPos;
270 long num = 0L;
271 long num2 = 0L;
272 this.Flush(num != 0L, num2 != 0L);
273 int num3 = Math.Min(0, -1073741824);
274 int charPos3 = this._charPos;
276 }
277
278 // Token: 0x060027C8 RID: 10184 RVA: 0x000566B4 File Offset: 0x000548B4
279 public override void Write(char[] buffer, int index, int count)
280 {
281 if (buffer == null)
282 {
283 return;
284 }
287 int charPos = this._charPos;
288 bool autoFlush = this._autoFlush;
289 if (this._charBuffer != null)
290 {
291 int charPos2 = this._charPos;
292 long num = 0L;
293 long num2 = 0L;
294 this.Flush(num != 0L, num2 != 0L);
295 int num3 = Math.Min(0, count);
296 int charPos3 = this._charPos;
298 return;
299 }
300 }
301
302 // Token: 0x060027C9 RID: 10185 RVA: 0x00056750 File Offset: 0x00054950
303 private void WriteSpan(ReadOnlySpan<char> buffer, bool appendNewLine)
304 {
305 do
306 {
308 int charPos = this._charPos;
309 bool autoFlush = this._autoFlush;
310 }
311 while (this._charBuffer == null);
312 int charPos2 = this._charPos;
313 long num = 0L;
314 long num2 = 0L;
315 this.Flush(num != 0L, num2 != 0L);
316 int num3 = Math.Min(0, appendNewLine ? 1 : 0);
317 int charPos3 = this._charPos;
319 }
320
321 // Token: 0x060027CA RID: 10186 RVA: 0x00056814 File Offset: 0x00054A14
322 public override void Write(string value)
323 {
324 int stringLength;
325 while (value == null)
326 {
328 int charPos = this._charPos;
329 bool autoFlush = this._autoFlush;
330 if (this._charBuffer != null)
331 {
332 int charPos2 = this._charPos;
333 long num = 0L;
334 long num2 = 0L;
335 this.Flush(num != 0L, num2 != 0L);
336 int num3 = Math.Min(0, stringLength);
337 int charPos3 = this._charPos;
339 return;
340 }
341 }
342 char rawStringData = value.GetRawStringData();
343 stringLength = value._stringLength;
344 }
345
346 // Token: 0x060027CB RID: 10187 RVA: 0x000568B4 File Offset: 0x00054AB4
347 public override void WriteLine(string value)
348 {
349 for (;;)
350 {
352 if (value != null)
353 {
354 break;
355 }
357 int charPos = this._charPos;
358 bool autoFlush = this._autoFlush;
359 if (this._charBuffer != null)
360 {
361 goto Block_1;
362 }
363 }
364 char rawStringData = value.GetRawStringData();
365 int stringLength = value._stringLength;
366 return;
367 Block_1:
368 int charPos2 = this._charPos;
369 long num = 0L;
370 long num2 = 0L;
371 this.Flush(num != 0L, num2 != 0L);
372 int num3 = Math.Min(0, stringLength);
373 int charPos3 = this._charPos;
375 }
376
377 // Token: 0x060027CC RID: 10188 RVA: 0x00056994 File Offset: 0x00054B94
378 // Note: this type is marked as 'beforefieldinit'.
380 {
381 if (!true)
382 {
383 }
385 }
386
387 // Token: 0x040015A4 RID: 5540
388 public new static readonly StreamWriter Null;
389
390 // Token: 0x040015A5 RID: 5541
392
393 // Token: 0x040015A6 RID: 5542
395
396 // Token: 0x040015A7 RID: 5543
398
399 // Token: 0x040015A8 RID: 5544
400 private byte[] _byteBuffer;
401
402 // Token: 0x040015A9 RID: 5545
403 private char[] _charBuffer;
404
405 // Token: 0x040015AA RID: 5546
406 private int _charPos;
407
408 // Token: 0x040015AB RID: 5547
409 private int _charLen;
410
411 // Token: 0x040015AC RID: 5548
412 private bool _autoFlush;
413
414 // Token: 0x040015AD RID: 5549
416
417 // Token: 0x040015AE RID: 5550
418 private bool _closable;
419
420 // Token: 0x040015AF RID: 5551
422 }
423}
class f__AnonymousType0<< Count > j__TPar
static void SuppressFinalize(object obj)
Definition GC.cs:116
void Flush(bool flushStream, bool flushEncoder)
override void Dispose(bool disposing)
override void Write(char[] buffer, int index, int count)
StreamWriter(Stream stream, Encoding encoding, int bufferSize, bool leaveOpen)
static Encoding UTF8NoBOM
static void ThrowAsyncIOInProgress()
override void Flush()
override void Close()
override void Write(char[] buffer)
static new readonly StreamWriter Null
override void WriteLine(string value)
StreamWriter(Stream stream)
override void Write(char value)
StreamWriter(Stream stream, Encoding encoding)
void Init(Stream streamArg, Encoding encodingArg, int bufferSize, bool shouldLeaveOpen)
StreamWriter(string path, bool append)
StreamWriter(string path, bool append, Encoding encoding, int bufferSize)
StreamWriter(string path)
StreamWriter(Stream stream, Encoding encoding, int bufferSize)
override void Write(string value)
void WriteSpan(ReadOnlySpan< char > buffer, bool appendNewLine)
static byte Min(byte val1, byte val2)
Definition Math.cs:152
static void ThrowArgumentOutOfRangeException()