示例#1
0
 public static PrimitiveReturn convertStackItem(PrimitiveType item)
 {
     return(item.Type switch
     {
         StackItemType.Boolean => new PrimitiveReturn(item, item.GetBoolean()),
         StackItemType.Integer => new IntegerReturn(item, item.GetInteger().ToByteArray()),
         StackItemType.ByteString => new PrimitiveReturn(item, item.GetSpan().ToArray()),
         _ => throw new ArgumentException($"{item.Type} is not a valid StackItem argument")
     });
示例#2
0
 public ByteArrayWrapper(PrimitiveType value)
 {
     this.array = value.GetSpan().ToArray();
 }