Prepare for many parsers
This commit is contained in:
@@ -14,7 +14,7 @@ namespace mROA.Cbor
|
||||
{
|
||||
public class CborSerializationToolkit : IContextualSerializationToolKit
|
||||
{
|
||||
private readonly CborWriter _writer = new(initialCapacity: 512);
|
||||
private readonly CborWriter _writer = new(initialCapacity: 2048);
|
||||
|
||||
private readonly IOrdinaryStructureParser[] _parsers =
|
||||
{
|
||||
@@ -118,6 +118,11 @@ namespace mROA.Cbor
|
||||
return Convert.ChangeType(nonCasted, type);
|
||||
}
|
||||
|
||||
public IContextualSerializationToolKit Clone()
|
||||
{
|
||||
return new CborSerializationToolkit();
|
||||
}
|
||||
|
||||
public void WriteData(object? obj, CborWriter writer, IEndPointContext? context)
|
||||
{
|
||||
if (obj is not null && FindParser(obj.GetType(), out var parser))
|
||||
|
||||
Reference in New Issue
Block a user