Skip to content

Commit

Permalink
Write using MemoryStream.WriteTo.
Browse files Browse the repository at this point in the history
Fix #35
  • Loading branch information
hultqvist committed Jul 8, 2015
1 parent a0144cd commit 1b2c45e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion CodeGenerator/CodeGenerator/FieldSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static void BytesWriter(Field f, string stream, CodeWriter cw)
//10% faster than original using GetBuffer rather than ToArray
cw.WriteLine("uint length" + f.ID + " = (uint)msField.Length;");
cw.WriteLine(ProtocolParser.Base + ".WriteUInt32(" + stream + ", length" + f.ID + ");");
cw.WriteLine(stream + ".Write(msField.GetBuffer(), 0, (int)length" + f.ID + ");");
cw.WriteLine("msField.WriteTo("+stream+");");
}

/// <summary>
Expand Down

0 comments on commit 1b2c45e

Please sign in to comment.