Skip to content

Commit 9941175

Browse files
committed
Removed json references in .NET 8.0.
1 parent 4d573eb commit 9941175

3 files changed

Lines changed: 2 additions & 26 deletions

File tree

8.0/Numerics/Numerics.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
2828
<WarningLevel>1</WarningLevel>
2929
</PropertyGroup>
30-
30+
3131
<ItemGroup>
3232
<None Remove="new-joe-kuo-6.21201" />
3333
<None Remove="Properties\new-joe-kuo-6.21201" />
@@ -62,5 +62,5 @@
6262
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
6363
</EmbeddedResource>
6464
</ItemGroup>
65-
65+
6666
</Project>

8.0/Numerics/Sampling/MCMC/Support/MCMCResults.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
using System.IO;
3636
using System.Linq;
3737
using System.Runtime.Serialization.Formatters.Binary;
38-
using System.Text.Json;
3938

4039
namespace Numerics.Sampling.MCMC
4140
{
@@ -149,8 +148,6 @@ private void ProcessParameterResults(MCMCSampler sampler, double alpha = 0.1)
149148
/// <param name="mcmcResults">The MCMC Results.</param>
150149
public static byte[] ToByteArray(MCMCResults mcmcResults)
151150
{
152-
//return JsonSerializer.SerializeToUtf8Bytes(mcmcResults);
153-
154151
var bf = new BinaryFormatter();
155152
using (var ms = new MemoryStream())
156153
{
@@ -165,8 +162,6 @@ public static byte[] ToByteArray(MCMCResults mcmcResults)
165162
/// <param name="bytes">Byte array.</param>
166163
public static MCMCResults FromByteArray(byte[] bytes)
167164
{
168-
//return JsonSerializer.Deserialize<MCMCResults>(bytes);
169-
170165
using (var ms = new MemoryStream())
171166
{
172167
var bf = new BinaryFormatter();

8.0/Numerics/Utilities/Tools.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
using Numerics.Data.Statistics;
3232
using System.IO.Compression;
33-
using System.Text.Json;
3433

3534
namespace Numerics
3635
{
@@ -628,23 +627,5 @@ public static byte[] Decompress(byte[] data)
628627
return output.ToArray();
629628
}
630629

631-
/// <summary>
632-
/// Returns the object as a byte array.
633-
/// </summary>
634-
/// <param name="obj">The object to convert.</param>
635-
public static byte[] ToByteArray(object obj)
636-
{
637-
return JsonSerializer.SerializeToUtf8Bytes(obj);
638-
}
639-
640-
/// <summary>
641-
/// Returns the object from a byte array.
642-
/// </summary>
643-
/// <param name="bytes">Byte array.</param>
644-
public static T FromByteArray<T>(byte[] bytes)
645-
{
646-
return JsonSerializer.Deserialize<T>(bytes);
647-
}
648-
649630
}
650631
}

0 commit comments

Comments
 (0)