File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public int Position
3131 }
3232
3333 private int _position ;
34- private int readHead ;
34+ public int readHead ;
3535
3636 public static MessageReader GetSized ( int minSize )
3737 {
Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ public byte[] ToByteArray(bool includeHeader)
6363
6464 ///
6565 /// <param name="sendOption">The option specifying how the message should be sent.</param>
66- public static MessageWriter Get ( SendOption sendOption = SendOption . None )
66+ public static MessageWriter Get ( SendOption sendOption = SendOption . None , bool clearArray = true )
6767 {
6868 var output = WriterPool . GetObject ( ) ;
69- output . Clear ( sendOption ) ;
69+ output . Clear ( sendOption , clearArray ) ;
7070
7171 return output ;
7272 }
@@ -113,9 +113,10 @@ public void ClearMessageStarts()
113113 this . messageStarts . Clear ( ) ;
114114 }
115115
116- public void Clear ( SendOption sendOption )
116+ public void Clear ( SendOption sendOption , bool clearArray = true )
117117 {
118- ClearMessageStarts ( ) ;
118+ if ( clearArray ) { Array . Clear ( this . Buffer , 0 , this . Buffer . Length ) ; }
119+ this . messageStarts . Clear ( ) ;
119120 this . SendOption = sendOption ;
120121 this . Buffer [ 0 ] = ( byte ) sendOption ;
121122 switch ( sendOption )
You can’t perform that action at this time.
0 commit comments