Beispiel #1
0
        public override TMap ReadMapBegin()
        {
            TMap map = new TMap();
            map.KeyType = (TType)ReadByte();
            map.ValueType = (TType)ReadByte();
            map.Count = ReadI32();

            return map;
        }
Beispiel #2
0
 public override void WriteMapBegin(TMap map)
 {
     WriteByte((byte)map.KeyType);
     WriteByte((byte)map.ValueType);
     WriteI32(map.Count);
 }
 public override void WriteMapBegin(TMap map)
 {
     WriteJSONArrayStart();
     WriteJSONString(GetTypeNameForTypeID(map.KeyType));
     WriteJSONString(GetTypeNameForTypeID(map.ValueType));
     WriteJSONInteger(map.Count);
     WriteJSONObjectStart();
 }
Beispiel #4
0
 public override void WriteMapBegin(TMap tMap) 
 {
     WrappedProtocol.WriteMapBegin(tMap);
 }
Beispiel #5
0
		public abstract void WriteMapBegin(TMap map);
 public override TMap ReadMapBegin()
 {
     TMap map = new TMap();
     ReadJSONArrayStart();
     map.KeyType = GetTypeIDForTypeName(ReadJSONString(false));
     map.ValueType = GetTypeIDForTypeName(ReadJSONString(false));
     map.Count = (int)ReadJSONInteger();
     ReadJSONObjectStart();
     return map;
 }
 /**
  * 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(TMap map)
 {
     if (map.Count == 0)
     {
         WriteByteDirect(0);
     }
     else
     {
         WriteVarint32((uint)map.Count);
         WriteByteDirect(getCompactType(map.KeyType) << 4 | getCompactType(map.ValueType));
     }
 }
Beispiel #8
0
 public abstract Task WriteMapBeginAsync(TMap map);
 public override void WriteMapBegin(TMap map)
 {
 }
 public override void WriteMapBegin(TMap map)
 {
     WriteJSONObjectStart();
 }
Beispiel #11
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 async Task WriteMapBeginAsync(TMap map)
 {
     if (map.Count == 0)
     {
         await WriteByteDirectAsync(0);
     }
     else
     {
         await WriteVarint32Async((uint)map.Count);
         await WriteByteDirectAsync(getCompactType(map.KeyType) << 4 | getCompactType(map.ValueType));
     }
 }
 public abstract void WriteMapBegin(TMap map);
 public override async Task WriteMapBeginAsync(TMap map, CancellationToken cancellationToken)
 {
     await _wrappedProtocol.WriteMapBeginAsync(map, cancellationToken);
 }