Пример #1
0
        public void AddLengthEncoded(ISerializedType value)
        {
            var bytes = new BytesList();

            value.ToBytesSink(bytes);
            AddLengthEncoded(bytes);
        }
Пример #2
0
 public void Add(Field field, ISerializedType value)
 {
     AddFieldHeader(field);
     if (field.IsVlEncoded())
     {
         AddLengthEncoded(value);
     }
     else
     {
         value.ToBytesSink(_sink);
         if (field.Type == Fields.Type.StObject)
         {
             AddFieldHeader(Field.ObjectEndMarker);
         }
         else if (field.Type == Fields.Type.StArray)
         {
             AddFieldHeader(Field.ArrayEndMarker);
         }
     }
 }
Пример #3
0
 public void Add(Field field, ISerializedType value)
 {
     AddFieldHeader(field);
     if (field.IsVlEncoded())
     {
         AddLengthEncoded(value);
     }
     else
     {
         value.ToBytesSink(_sink);
         if (field.Type == Fields.Type.StObject)
         {
             AddFieldHeader(Field.ObjectEndMarker);
         }
         else if (field.Type == Fields.Type.StArray)
         {
             AddFieldHeader(Field.ArrayEndMarker);
         }
     }
 }
Пример #4
0
 public void Write(ISerializedType obj)
 {
     obj.ToBytesSink(_list);
 }
Пример #5
0
 public void AddLengthEncoded(ISerializedType value)
 {
     var bytes = new BytesList();
     value.ToBytesSink(bytes);
     AddLengthEncoded(bytes);
 }