Repository: ignite Updated Branches: refs/heads/ignite-1567 e69afa1f1 -> 0565eec0d
IGNITE-1567: More correct fix. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0565eec0 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0565eec0 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0565eec0 Branch: refs/heads/ignite-1567 Commit: 0565eec0d8881ff35137767708c932ff800bfa26 Parents: e69afa1 Author: vozerov-gridgain <voze...@gridgain.com> Authored: Tue Sep 29 17:42:00 2015 +0300 Committer: vozerov-gridgain <voze...@gridgain.com> Committed: Tue Sep 29 17:42:00 2015 +0300 ---------------------------------------------------------------------- .../Impl/Portable/PortableWriterImpl.cs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/0565eec0/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableWriterImpl.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableWriterImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableWriterImpl.cs index e55cc9d..a2de3b3 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableWriterImpl.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableWriterImpl.cs @@ -992,12 +992,8 @@ namespace Apache.Ignite.Core.Impl.Portable WriteNullRawField(); else { - int pos = SkipFieldLength(); - _stream.WriteByte(PU.TypeArrayEnum); PortableUtils.WriteArray(val, this, true); - - WriteFieldLength(_stream, pos); } } @@ -1067,12 +1063,8 @@ namespace Apache.Ignite.Core.Impl.Portable WriteNullRawField(); else { - int pos = SkipFieldLength(); - _stream.WriteByte(PU.TypeArray); PortableUtils.WriteArray(val, this, true); - - WriteFieldLength(_stream, pos); } } @@ -1630,13 +1622,9 @@ namespace Apache.Ignite.Core.Impl.Portable /// <param name="pos">Position where length should reside</param> private static void WriteFieldLength(IPortableStream stream, int pos) { - int retPos = stream.Position; - - stream.Seek(pos, SeekOrigin.Begin); - - stream.WriteInt(retPos - pos - 4); - - stream.Seek(retPos, SeekOrigin.Begin); + // Length is is a difference between current position and previously recorder + // length placeholder position minus 4 bytes for the length itself. + stream.WriteInt(pos, stream.Position - pos - 4); } /// <summary>