14
14
*/
15
15
16
16
using System ;
17
+ using System . Text ;
17
18
using MongoDB . Bson ;
18
19
19
20
namespace MongoDB . Driver
@@ -32,6 +33,7 @@ public static class MongoDefaults
32
33
private static int __maxConnectionPoolSize = 100 ;
33
34
private static int __maxMessageLength = 16000000 ; // 16MB (not 16 MiB!)
34
35
private static int __minConnectionPoolSize = 0 ;
36
+ private static UTF8Encoding __readEncoding = new UTF8Encoding ( false , true ) ;
35
37
#pragma warning disable 612 , 618
36
38
private static SafeMode __safeMode = SafeMode . False ;
37
39
#pragma warning restore
@@ -42,6 +44,7 @@ public static class MongoDefaults
42
44
private static double __waitQueueMultiple = 5.0 ; // default wait queue multiple is 5.0
43
45
private static int __waitQueueSize = 0 ; // use multiple by default
44
46
private static TimeSpan __waitQueueTimeout = TimeSpan . FromMinutes ( 2 ) ; // default wait queue timeout is 2 minutes
47
+ private static UTF8Encoding __writeEncoding = new UTF8Encoding ( false , true ) ;
45
48
46
49
// public static properties
47
50
/// <summary>
@@ -152,6 +155,22 @@ public static int MinConnectionPoolSize
152
155
set { __minConnectionPoolSize = value ; }
153
156
}
154
157
158
+ /// <summary>
159
+ /// Gets or sets the Read Encoding.
160
+ /// </summary>
161
+ public static UTF8Encoding ReadEncoding
162
+ {
163
+ get { return __readEncoding ; }
164
+ set
165
+ {
166
+ if ( value == null )
167
+ {
168
+ throw new ArgumentNullException ( "value" ) ;
169
+ }
170
+ __readEncoding = value ;
171
+ }
172
+ }
173
+
155
174
/// <summary>
156
175
/// Gets or sets the safe mode.
157
176
/// </summary>
@@ -233,5 +252,21 @@ public static TimeSpan WaitQueueTimeout
233
252
get { return __waitQueueTimeout ; }
234
253
set { __waitQueueTimeout = value ; }
235
254
}
255
+
256
+ /// <summary>
257
+ /// Gets or sets the Write Encoding.
258
+ /// </summary>
259
+ public static UTF8Encoding WriteEncoding
260
+ {
261
+ get { return __writeEncoding ; }
262
+ set
263
+ {
264
+ if ( value == null )
265
+ {
266
+ throw new ArgumentNullException ( "value" ) ;
267
+ }
268
+ __writeEncoding = value ;
269
+ }
270
+ }
236
271
}
237
272
}
0 commit comments