Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ BinaryWriter() [4/4]

System.IO.BinaryWriter.BinaryWriter ( Stream output,
Encoding encoding,
bool leaveOpen )
inline

Definition at line 47 of file BinaryWriter.cs.

48 {
49 if (output == null)
50 {
51 throw new ArgumentNullException("output");
52 }
53 if (encoding == null)
54 {
55 throw new ArgumentNullException("encoding");
56 }
57 if (!output.CanWrite)
58 {
59 throw new ArgumentException(SR.Argument_StreamNotWritable);
60 }
61 OutStream = output;
62 _encoding = encoding;
63 _leaveOpen = leaveOpen;
64 _useFastUtf8 = encoding.IsUTF8CodePage && encoding.EncoderFallback.MaxCharCount <= 1;
65 }
readonly bool _leaveOpen
readonly bool _useFastUtf8
readonly Encoding _encoding

References System.IO.BinaryWriter._encoding, System.IO.BinaryWriter._leaveOpen, System.IO.BinaryWriter._useFastUtf8, System.SR.Argument_StreamNotWritable, System.IO.Stream.CanWrite, and System.IO.BinaryWriter.OutStream.