Exemplo n.º 1
0
 public override void WriteMapBegin(Map map)
 {
     WriteJSONArrayStart();
     WriteJSONString(GetTypeNameForTypeID(map.KeyType));
     WriteJSONString(GetTypeNameForTypeID(map.ValueType));
     WriteJSONInteger(map.Count);
     WriteJSONObjectStart();
 }
Exemplo n.º 2
0
 public override Map ReadMapBegin()
 {
     Map map = new Map();
     ReadJSONArrayStart();
     map.KeyType = GetTypeIDForTypeName(ReadJSONString(false));
     map.ValueType = GetTypeIDForTypeName(ReadJSONString(false));
     map.Count = (int)ReadJSONInteger();
     ReadJSONObjectStart();
     return map;
 }
Exemplo n.º 3
0
 public override void WriteMapBegin(Map map)
 {
     WriteByte((byte)map.KeyType);
     WriteByte((byte)map.ValueType);
     WriteI32(map.Count);
 }
Exemplo n.º 4
0
        public override Map ReadMapBegin()
        {
            Map map = new Map();
            map.KeyType = (TType)ReadByte();
            map.ValueType = (TType)ReadByte();
            map.Count = ReadI32();

            return map;
        }
Exemplo n.º 5
0
 public abstract void WriteMapBegin(Map map);
Exemplo n.º 6
0
 /**
  * Write a map header. If the map is empty, omit the key and value type
  * headers, as we don't need any additional information to skip it.
  */
 public override void WriteMapBegin(Map map)
 {
     if (map.Count == 0)
     {
         WriteByteDirect(0);
     }
     else
     {
         WriteVarint32((uint)map.Count);
         WriteByteDirect(getCompactType(map.KeyType) << 4 | getCompactType(map.ValueType));
     }
 }