diff --git a/CDP4-SDK.sln b/CDP4-SDK.sln
index 6a69cabc..801dc90c 100644
--- a/CDP4-SDK.sln
+++ b/CDP4-SDK.sln
@@ -78,8 +78,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CDP4ServicesMessaging.Tests
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CDP4DalCommon", "CDP4DalCommon\CDP4DalCommon.csproj", "{E7CDB217-8442-4FD4-8E87-F4A8BFE9622A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDP4DalJsonSerializer", "CDP4DalJsonSerializer\CDP4DalJsonSerializer.csproj", "{36C38A02-C1CF-4F4F-AB40-F0A231256B30}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -210,10 +208,6 @@ Global
{E7CDB217-8442-4FD4-8E87-F4A8BFE9622A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7CDB217-8442-4FD4-8E87-F4A8BFE9622A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7CDB217-8442-4FD4-8E87-F4A8BFE9622A}.Release|Any CPU.Build.0 = Release|Any CPU
- {36C38A02-C1CF-4F4F-AB40-F0A231256B30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {36C38A02-C1CF-4F4F-AB40-F0A231256B30}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {36C38A02-C1CF-4F4F-AB40-F0A231256B30}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {36C38A02-C1CF-4F4F-AB40-F0A231256B30}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/CDP4DalJsonSerializer/CDP4DalJsonSerializer.csproj b/CDP4DalJsonSerializer/CDP4DalJsonSerializer.csproj
deleted file mode 100644
index b24045f1..00000000
--- a/CDP4DalJsonSerializer/CDP4DalJsonSerializer.csproj
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
- net47;net471;net472;net48;netstandard2.0;netstandard2.1
- Starion Group S.A.
- latest
- CDP4DalJsonSerializer Community Edition
- 28.0.0
- JsonSerializer for the CDP4DalCommon types
- Copyright © Starion Group S.A.
- Sam, Alex, Alexander, Nathanael, Antoine, Omar, Jaime
- CDP4DalJsonSerializer-CE
- true
- https://github.com/STARIONGROUP/COMET-SDK-Community-Edition
- true
- cdp4-icon.png
- true
- true
- snupkg
- https://github.com/STARIONGROUP/COMET-SDK-Community-Edition.git
- CDP COMET ECSS-E-TM-10-25
- LGPL-3.0-only
-
- [Refactor] Newtonsoft to System.Text.Json
-
- README.md
- true
- latest
-
-
-
- \
- true
-
-
- \
- true
-
-
-
-
-
-
-
diff --git a/CDP4JsonFileDal/CDP4JsonFileDal.csproj b/CDP4JsonFileDal/CDP4JsonFileDal.csproj
index 0f618bca..5656ccdc 100644
--- a/CDP4JsonFileDal/CDP4JsonFileDal.csproj
+++ b/CDP4JsonFileDal/CDP4JsonFileDal.csproj
@@ -37,7 +37,6 @@
-
diff --git a/CDP4JsonFileDal/JsonFileDal.cs b/CDP4JsonFileDal/JsonFileDal.cs
index 60813775..dc1020d1 100644
--- a/CDP4JsonFileDal/JsonFileDal.cs
+++ b/CDP4JsonFileDal/JsonFileDal.cs
@@ -48,8 +48,6 @@ namespace CDP4JsonFileDal
using CDP4DalCommon.Protocol.Operations;
using CDP4DalCommon.Protocol.Tasks;
- using CDP4DalJsonSerializer;
-
using CDP4JsonFileDal.Json;
using CDP4JsonSerializer;
diff --git a/CDP4JsonSerializer/CDP4JsonSerializer.csproj b/CDP4JsonSerializer/CDP4JsonSerializer.csproj
index a9530563..739c5a4e 100644
--- a/CDP4JsonSerializer/CDP4JsonSerializer.csproj
+++ b/CDP4JsonSerializer/CDP4JsonSerializer.csproj
@@ -44,6 +44,7 @@
+
\ No newline at end of file
diff --git a/CDP4DalJsonSerializer/Cdp4DalJsonSerializer.cs b/CDP4JsonSerializer/Cdp4DalJsonSerializer.cs
similarity index 80%
rename from CDP4DalJsonSerializer/Cdp4DalJsonSerializer.cs
rename to CDP4JsonSerializer/Cdp4DalJsonSerializer.cs
index 477449a5..2a5f15ce 100644
--- a/CDP4DalJsonSerializer/Cdp4DalJsonSerializer.cs
+++ b/CDP4JsonSerializer/Cdp4DalJsonSerializer.cs
@@ -22,26 +22,22 @@
//
// -------------------------------------------------------------------------------------------------------------------------------
-namespace CDP4DalJsonSerializer
+namespace CDP4JsonSerializer
{
using System;
using CDP4Common.MetaInfo;
- using CDP4DalCommon.Protocol.Operations;
-
- using CDP4DalJsonSerializer.JsonConverter;
-
- using CDP4JsonSerializer;
+ using CDP4JsonSerializer.JsonConverter;
///
- /// The is a that also supports (de)serialization of
- ///
+ /// The is a that also supports (de)serialization of
+ ///
///
public class Cdp4DalJsonSerializer : Cdp4JsonSerializer
{
///
- /// Asserts that the have to be ignored
+ /// Asserts that the have to be ignored
///
private readonly bool ignorePostOperationCopyProperty;
@@ -54,7 +50,7 @@ public class Cdp4DalJsonSerializer : Cdp4JsonSerializer
///
/// The supported version of the data-model
///
- /// Asserts that the have to be ignored
+ /// Asserts that the have to be ignored
public Cdp4DalJsonSerializer(IMetaDataProvider metaInfoProvider, Version supportedVersion, bool ignorePostOperationCopyProperty)
{
this.ignorePostOperationCopyProperty = ignorePostOperationCopyProperty;
@@ -62,16 +58,16 @@ public Cdp4DalJsonSerializer(IMetaDataProvider metaInfoProvider, Version support
}
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
- /// Asserts that the have to be ignored
+ /// Asserts that the have to be ignored
public Cdp4DalJsonSerializer(bool ignorePostOperationCopyProperty)
{
this.ignorePostOperationCopyProperty = ignorePostOperationCopyProperty;
}
///
- /// Initialize the property
+ /// Initialize the property
///
public override void InitializeJsonSerializerOptions()
{
diff --git a/CDP4DalJsonSerializer/Extensions/JsonElementExtensions.cs b/CDP4JsonSerializer/Extensions/JsonElementExtensions.cs
similarity index 81%
rename from CDP4DalJsonSerializer/Extensions/JsonElementExtensions.cs
rename to CDP4JsonSerializer/Extensions/JsonElementExtensions.cs
index c1a922b9..d6bd679b 100644
--- a/CDP4DalJsonSerializer/Extensions/JsonElementExtensions.cs
+++ b/CDP4JsonSerializer/Extensions/JsonElementExtensions.cs
@@ -22,7 +22,7 @@
//
// -------------------------------------------------------------------------------------------------------------------------------
-namespace CDP4DalJsonSerializer.Extensions
+namespace CDP4JsonSerializer.Extensions
{
using System.Collections.Generic;
using System.Text.Json;
@@ -34,16 +34,16 @@ namespace CDP4DalJsonSerializer.Extensions
using CDP4DalCommon.Protocol.Operations;
///
- /// Extension class for
+ /// Extension class for
///
public static class JsonElementExtensions
{
///
- /// Deserialize the content of the to the
+ /// Deserialize the content of the to the
///
- /// The
- /// The that will receive new value properties
- /// The
+ /// The
+ /// The that will receive new value properties
+ /// The
public static void DeserializePostOperation(this JsonElement element, PostOperation postOperation, JsonSerializerOptions serializerOptions)
{
if (element.TryGetProperty("_delete", out var deleteElement))
diff --git a/CDP4DalJsonSerializer/JsonConverter/PostOperationJsonConverter.cs b/CDP4JsonSerializer/JsonConverter/PostOperationJsonConverter.cs
similarity index 92%
rename from CDP4DalJsonSerializer/JsonConverter/PostOperationJsonConverter.cs
rename to CDP4JsonSerializer/JsonConverter/PostOperationJsonConverter.cs
index c391f0cb..5cb46297 100644
--- a/CDP4DalJsonSerializer/JsonConverter/PostOperationJsonConverter.cs
+++ b/CDP4JsonSerializer/JsonConverter/PostOperationJsonConverter.cs
@@ -22,7 +22,7 @@
//
// -------------------------------------------------------------------------------------------------------------------------------
-namespace CDP4DalJsonSerializer.JsonConverter
+namespace CDP4JsonSerializer.JsonConverter
{
using System;
using System.IO;
@@ -31,15 +31,14 @@ namespace CDP4DalJsonSerializer.JsonConverter
using System.Text.Json.Serialization;
using CDP4Common.Polyfills;
-
using CDP4DalCommon.Protocol.Operations;
- using CDP4DalJsonSerializer.Extensions;
+ using CDP4JsonSerializer.Extensions;
using NLog;
///
- /// The for s
+ /// The for s
///
public class PostOperationJsonConverter: JsonConverter
{
@@ -49,14 +48,14 @@ public class PostOperationJsonConverter: JsonConverter
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
///
- /// Asserts that the have to be ignored
+ /// Asserts that the have to be ignored
///
private readonly bool ignoreCopyProperty;
///
/// Initializes a new instance.
///
- /// Asserts that the have to be ignored
+ /// Asserts that the have to be ignored
public PostOperationJsonConverter(bool ignoreCopyProperty)
{
this.ignoreCopyProperty = ignoreCopyProperty;
@@ -76,7 +75,7 @@ public override bool CanConvert(Type typeToConvert)
return typeof(PostOperation).QueryIsAssignableFrom(typeToConvert);
}
- /// Reads and converts the JSON to type .
+ /// Reads and converts the JSON to type .
/// The reader.
/// The type to convert.
/// An object that specifies serialization options to use.
diff --git a/CDP4ServicesDal.NetCore.Tests/CDP4ServicesDal.NetCore.Tests.csproj b/CDP4ServicesDal.NetCore.Tests/CDP4ServicesDal.NetCore.Tests.csproj
index 865cfab6..0f1670ea 100644
--- a/CDP4ServicesDal.NetCore.Tests/CDP4ServicesDal.NetCore.Tests.csproj
+++ b/CDP4ServicesDal.NetCore.Tests/CDP4ServicesDal.NetCore.Tests.csproj
@@ -11,7 +11,6 @@
-
diff --git a/CDP4ServicesDal.NetCore.Tests/CdpServicesDalTestFixture.cs b/CDP4ServicesDal.NetCore.Tests/CdpServicesDalTestFixture.cs
index 8edcbd97..6a479f97 100644
--- a/CDP4ServicesDal.NetCore.Tests/CdpServicesDalTestFixture.cs
+++ b/CDP4ServicesDal.NetCore.Tests/CdpServicesDalTestFixture.cs
@@ -849,7 +849,7 @@ public async Task VerifyWriteLongRunningTask()
requestHandler.Respond(_ => thingsResponse);
var stream = new MemoryStream();
- this.dal.Cdp4JsonSerializer.SerializeToStream(this.iteration, stream, true);
+ this.dal.Cdp4DalJsonSerializer.SerializeToStream(this.iteration, stream, true);
stream.Position = 0;
thingsResponse.Content = new StreamContent(stream);
SetHttpHeader(thingsResponse, "application/json");
diff --git a/CDP4ServicesDal.NetCore.Tests/PostOperationTestFixture.cs b/CDP4ServicesDal.NetCore.Tests/PostOperationTestFixture.cs
index c72c2ae4..ac195a93 100644
--- a/CDP4ServicesDal.NetCore.Tests/PostOperationTestFixture.cs
+++ b/CDP4ServicesDal.NetCore.Tests/PostOperationTestFixture.cs
@@ -39,7 +39,7 @@ namespace CDP4ServicesDal.Tests
using CDP4DalCommon.Protocol.Operations;
- using CDP4DalJsonSerializer;
+ using CDP4JsonSerializer;
using CDP4ServicesDal.Tests.Helper;
diff --git a/CDP4ServicesDal.Tests/CdpServicesDalTestFixture.cs b/CDP4ServicesDal.Tests/CdpServicesDalTestFixture.cs
index 79a86cb2..bd1b5b86 100644
--- a/CDP4ServicesDal.Tests/CdpServicesDalTestFixture.cs
+++ b/CDP4ServicesDal.Tests/CdpServicesDalTestFixture.cs
@@ -883,7 +883,7 @@ public async Task VerifyWriteLongRunningTask()
requestHandler.Respond(_ => thingsResponse);
var stream = new MemoryStream();
- this.dal.Cdp4JsonSerializer.SerializeToStream(this.iteration, stream, true);
+ this.dal.Cdp4DalJsonSerializer.SerializeToStream(this.iteration, stream, true);
stream.Position = 0;
thingsResponse.Content = new StreamContent(stream);
SetHttpHeader(thingsResponse, "application/json");
diff --git a/CDP4ServicesDal.Tests/PostOperationTestFixture.cs b/CDP4ServicesDal.Tests/PostOperationTestFixture.cs
index 24d8bf43..9c3f5d5e 100644
--- a/CDP4ServicesDal.Tests/PostOperationTestFixture.cs
+++ b/CDP4ServicesDal.Tests/PostOperationTestFixture.cs
@@ -39,7 +39,7 @@ namespace CDP4ServicesDal.Tests
using CDP4DalCommon.Protocol.Operations;
- using CDP4DalJsonSerializer;
+ using CDP4JsonSerializer;
using CDP4ServicesDal.Tests.Helper;
diff --git a/CDP4ServicesDal/CDP4ServicesDal.csproj b/CDP4ServicesDal/CDP4ServicesDal.csproj
index f0387a20..a4915fd7 100644
--- a/CDP4ServicesDal/CDP4ServicesDal.csproj
+++ b/CDP4ServicesDal/CDP4ServicesDal.csproj
@@ -42,8 +42,8 @@
-
+
diff --git a/CDP4ServicesDal/CdpServicesDal.cs b/CDP4ServicesDal/CdpServicesDal.cs
index c8f1226d..a1205880 100644
--- a/CDP4ServicesDal/CdpServicesDal.cs
+++ b/CDP4ServicesDal/CdpServicesDal.cs
@@ -54,7 +54,7 @@ namespace CDP4ServicesDal
using CDP4DalCommon.Protocol.Operations;
using CDP4DalCommon.Protocol.Tasks;
- using CDP4DalJsonSerializer;
+ using CDP4JsonSerializer;
using CDP4MessagePackSerializer;
@@ -108,7 +108,7 @@ public CdpServicesDal(): this(true)
/// Asserts that the MessagePack deserialization should be used or not. Supported by default
public CdpServicesDal(bool isMessagePackSupported)
{
- this.Cdp4JsonSerializer = new Cdp4DalJsonSerializer(this.MetaDataProvider, this.DalVersion, false);
+ this.Cdp4DalJsonSerializer = new Cdp4DalJsonSerializer(this.MetaDataProvider, this.DalVersion, false);
this.MessagePackSerializer = new MessagePackSerializer();
this.isMessagePackSupported = isMessagePackSupported;
@@ -132,9 +132,9 @@ public CdpServicesDal(HttpClient httpClient, bool isMessagePackSupported = true)
}
///
- /// Gets the
+ /// Gets the
///
- public Cdp4DalJsonSerializer Cdp4JsonSerializer { get; private set; }
+ public Cdp4DalJsonSerializer Cdp4DalJsonSerializer { get; private set; }
///
/// Gets the
@@ -225,7 +225,7 @@ public override async Task> Write(OperationContainer operatio
{
case ContentTypeKind.JSON:
Logger.Info("Deserializing JSON response");
- result.AddRange(this.Cdp4JsonSerializer.Deserialize(resultStream));
+ result.AddRange(this.Cdp4DalJsonSerializer.Deserialize(resultStream));
Logger.Info("JSON Deserializer completed in {0} [ms]", deserializationWatch.ElapsedMilliseconds);
break;
case ContentTypeKind.MESSAGEPACK:
@@ -517,7 +517,7 @@ public override async Task> Read(IEnumerable> Read(T thing, CancellationToke
{
case ContentTypeKind.JSON:
Logger.Info("Deserializing JSON response");
- returned = this.Cdp4JsonSerializer.Deserialize(resultStream);
+ returned = this.Cdp4DalJsonSerializer.Deserialize(resultStream);
Logger.Info("JSON Deserializer completed in {0} [ms]", deserializationWatch.ElapsedMilliseconds);
break;
case ContentTypeKind.MESSAGEPACK:
@@ -746,7 +746,7 @@ public override async Task ReadCometTask(Guid id, CancellationToken c
{
case ContentTypeKind.JSON:
Logger.Info("Deserializing JSON response");
- returned = this.Cdp4JsonSerializer.Deserialize(resultStream);
+ returned = this.Cdp4DalJsonSerializer.Deserialize(resultStream);
Logger.Info("JSON Deserializer completed in {0} [ms]", deserializationWatch.ElapsedMilliseconds);
break;
case ContentTypeKind.MESSAGEPACK:
@@ -807,7 +807,7 @@ public override async Task> ReadCometTasks(CancellationTo
{
case ContentTypeKind.JSON:
Logger.Info("Deserializing JSON response");
- returned = this.Cdp4JsonSerializer.Deserialize>(resultStream);
+ returned = this.Cdp4DalJsonSerializer.Deserialize>(resultStream);
Logger.Info("JSON Deserializer completed in {0} [ms]", deserializationWatch.ElapsedMilliseconds);
break;
case ContentTypeKind.MESSAGEPACK:
@@ -951,7 +951,7 @@ public override async Task> Open(Credentials credentials, Can
{
case ContentTypeKind.JSON:
Logger.Info("Deserializing JSON response");
- returned = this.Cdp4JsonSerializer.Deserialize(resultStream);
+ returned = this.Cdp4DalJsonSerializer.Deserialize(resultStream);
Logger.Info("JSON Deserializer completed in {0} [ms]", deserializationWatch.ElapsedMilliseconds);
break;
case ContentTypeKind.MESSAGEPACK:
@@ -1195,7 +1195,7 @@ internal void ConstructPostRequestBodyStream(string token, OperationContainer op
postOperation.ConstructFromOperation(operation);
}
- this.Cdp4JsonSerializer.SerializeToStream(postOperation, outputStream);
+ this.Cdp4DalJsonSerializer.SerializeToStream(postOperation, outputStream);
outputStream.Position = 0;
if (Logger.IsTraceEnabled)
@@ -1425,8 +1425,8 @@ private LongRunningTaskResult ExtractResultFromStream(Stream stream)
stream.Position = 0;
return firstChar == '['
- ? new LongRunningTaskResult(this.Cdp4JsonSerializer.Deserialize(stream))
- : new LongRunningTaskResult(this.Cdp4JsonSerializer.Deserialize(stream));
+ ? new LongRunningTaskResult(this.Cdp4DalJsonSerializer.Deserialize(stream))
+ : new LongRunningTaskResult(this.Cdp4DalJsonSerializer.Deserialize(stream));
}
}
diff --git a/CDP4WspDal.NetCore.Tests/PostOperationTestFixture.cs b/CDP4WspDal.NetCore.Tests/PostOperationTestFixture.cs
index d9767951..06a7118f 100644
--- a/CDP4WspDal.NetCore.Tests/PostOperationTestFixture.cs
+++ b/CDP4WspDal.NetCore.Tests/PostOperationTestFixture.cs
@@ -39,7 +39,7 @@ namespace CDP4WspDal.Tests
using CDP4DalCommon.Protocol.Operations;
- using CDP4DalJsonSerializer;
+ using CDP4JsonSerializer;
using CDP4WspDal.Tests.Helper;
diff --git a/CDP4WspDal.Tests/PostOperationTestFixture.cs b/CDP4WspDal.Tests/PostOperationTestFixture.cs
index d9767951..06a7118f 100644
--- a/CDP4WspDal.Tests/PostOperationTestFixture.cs
+++ b/CDP4WspDal.Tests/PostOperationTestFixture.cs
@@ -39,7 +39,7 @@ namespace CDP4WspDal.Tests
using CDP4DalCommon.Protocol.Operations;
- using CDP4DalJsonSerializer;
+ using CDP4JsonSerializer;
using CDP4WspDal.Tests.Helper;
diff --git a/CDP4WspDal/CDP4WspDal.csproj b/CDP4WspDal/CDP4WspDal.csproj
index 30860472..6de44c4e 100644
--- a/CDP4WspDal/CDP4WspDal.csproj
+++ b/CDP4WspDal/CDP4WspDal.csproj
@@ -41,8 +41,8 @@
-
+
diff --git a/CDP4WspDal/WSPDal.cs b/CDP4WspDal/WSPDal.cs
index 995f5714..e704a89b 100644
--- a/CDP4WspDal/WSPDal.cs
+++ b/CDP4WspDal/WSPDal.cs
@@ -52,7 +52,7 @@ namespace CDP4WspDal
using CDP4DalCommon.Protocol.Operations;
using CDP4DalCommon.Protocol.Tasks;
- using CDP4DalJsonSerializer;
+ using CDP4JsonSerializer;
using NLog;
@@ -83,13 +83,13 @@ public class WspDal : Dal
///
public WspDal()
{
- this.Serializer = new Cdp4DalJsonSerializer(this.MetaDataProvider, this.DalVersion, true);
+ this.Cdp4DalJsonSerializer = new Cdp4DalJsonSerializer(this.MetaDataProvider, this.DalVersion, true);
}
///
- /// Gets or sets the
+ /// Gets or sets the
///
- public Cdp4DalJsonSerializer Serializer { get; private set; }
+ public Cdp4DalJsonSerializer Cdp4DalJsonSerializer { get; private set; }
///
/// Gets the value indicating whether this is read only
@@ -131,7 +131,7 @@ public override async Task> Write(OperationContainer operatio
var watch = Stopwatch.StartNew();
- var hasCopyValuesOperations = operationContainer.Operations.Any(op => OperationKindExtensions.IsCopyKeepOriginalValuesOperation(op.OperationKind));
+ var hasCopyValuesOperations = operationContainer.Operations.Any(op => op.OperationKind.IsCopyKeepOriginalValuesOperation());
var modifier = new OperationModifier(this.Session);
var copyHandler = new CopyOperationHandler(this.Session);
@@ -184,7 +184,7 @@ public override async Task> Write(OperationContainer operatio
using (var resultStream = await httpResponseMessage.Content.ReadAsStreamAsync())
{
- result.AddRange(this.Serializer.Deserialize(resultStream));
+ result.AddRange(this.Cdp4DalJsonSerializer.Deserialize(resultStream));
Guid iterationId;
@@ -408,7 +408,7 @@ public override async Task> Read(T thing, CancellationToke
using (var resultStream = await httpResponseMessage.Content.ReadAsStreamAsync())
{
- var returned = this.Serializer.Deserialize(resultStream);
+ var returned = this.Cdp4DalJsonSerializer.Deserialize(resultStream);
Guid iterationId;
@@ -563,7 +563,7 @@ public override async Task> Open(Credentials credentials, Can
using (var resultStream = await httpResponseMessage.Content.ReadAsStreamAsync())
{
- var returned = this.Serializer.Deserialize(resultStream);
+ var returned = this.Cdp4DalJsonSerializer.Deserialize(resultStream);
watch.Stop();
Logger.Info("JSON Deserializer completed in {0} [ms]", watch.ElapsedMilliseconds);
@@ -706,7 +706,7 @@ internal void ConstructPostRequestBodyStream(string token, OperationContainer op
postOperation.ConstructFromOperation(operation);
}
- this.Serializer.SerializeToStream(postOperation, outputStream);
+ this.Cdp4DalJsonSerializer.SerializeToStream(postOperation, outputStream);
outputStream.Position = 0;
if (Logger.IsTraceEnabled)