File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
projects/client/RabbitMQ.Client/src/util Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 38
38
// Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
39
39
//---------------------------------------------------------------------------
40
40
41
- using System ;
42
41
using System . IO ;
43
42
using System . Text ;
44
43
@@ -55,6 +54,8 @@ namespace RabbitMQ.Util
55
54
/// </remarks>
56
55
public class NetworkBinaryReader : BinaryReader
57
56
{
57
+ private static readonly Encoding encoding = new UTF8Encoding ( ) ;
58
+
58
59
// Not particularly efficient. To be more efficient, we could
59
60
// reuse BinaryReader's implementation details: m_buffer and
60
61
// FillBuffer, if they weren't private
@@ -65,7 +66,7 @@ public class NetworkBinaryReader : BinaryReader
65
66
/// <summary>
66
67
/// Construct a NetworkBinaryReader over the given input stream.
67
68
/// </summary>
68
- public NetworkBinaryReader ( Stream input ) : base ( input )
69
+ public NetworkBinaryReader ( Stream input ) : base ( input , encoding )
69
70
{
70
71
}
71
72
Original file line number Diff line number Diff line change 38
38
// Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
39
39
//---------------------------------------------------------------------------
40
40
41
- using System ;
42
41
using System . IO ;
43
42
using System . Text ;
44
43
@@ -57,10 +56,12 @@ namespace RabbitMQ.Util
57
56
/// </remarks>
58
57
public class NetworkBinaryWriter : BinaryWriter
59
58
{
59
+ private static readonly Encoding encoding = new UTF8Encoding ( false , true ) ;
60
+
60
61
/// <summary>
61
62
/// Construct a NetworkBinaryWriter over the given input stream.
62
63
/// </summary>
63
- public NetworkBinaryWriter ( Stream output ) : base ( output )
64
+ public NetworkBinaryWriter ( Stream output ) : base ( output , encoding )
64
65
{
65
66
}
66
67
You can’t perform that action at this time.
0 commit comments