コード例 #1
0
        public static string ToDebuggedHex(this ISerializedType st)
        {
            BytesList list = new BytesList();

            st.ToBytes(list);
            return(list.RawList().Aggregate("", (a, b) = \ > \ a + ',' + B16.Encode(b)));
        }
コード例 #2
0
        public static string ToHex(this ISerializedType st)
        {
            BytesList list = new BytesList();

            st.ToBytes(list);
            return(list.BytesHex());
        }
コード例 #3
0
        public void AddLengthEncoded(ISerializedType value)
        {
            var bytes = new BytesList();

            value.ToBytes(bytes);
            AddLengthEncoded(bytes);
        }
コード例 #4
0
 public void Add(Field field, ISerializedType value)
 {
     AddFieldHeader(field);
     if (field.IsVlEncoded)
     {
         AddLengthEncoded(value);
     }
     else
     {
         value.ToBytes(_sink);
         if (field.Type == FieldType.StObject)
         {
             AddFieldHeader(Field.ObjectEndMarker);
         }
         else if (field.Type == FieldType.StArray)
         {
             AddFieldHeader(Field.ArrayEndMarker);
         }
     }
 }
コード例 #5
0
 public void Add(Field field, ISerializedType value)
 {
     AddFieldHeader(field);
     if (field.IsVlEncoded)
     {
         AddLengthEncoded(value);
     }
     else
     {
         value.ToBytes(_sink);
         if (field.Type == FieldType.StObject)
         {
             AddFieldHeader(Field.ObjectEndMarker);
         }
         else if (field.Type == FieldType.StArray)
         {
             AddFieldHeader(Field.ArrayEndMarker);
         }
     }
 }
コード例 #6
0
 public void AddLengthEncoded(ISerializedType value)
 {
     var bytes = new BytesList();
     value.ToBytes(bytes);
     AddLengthEncoded(bytes);
 }