Exemple #1
0
        public override void Serialize(T obj, Stream stream)
        {
            switch (underlyingTypeCode)
            {
            case TypeCode.Int64:
            case TypeCode.UInt64:
                SimpleStreamUtil.Write(stream, EnumConvert.ToLong(obj));
                break;

            default:
                SimpleStreamUtil.Write7BitEncodedInt(stream, EnumConvert.ToInt(obj));
                break;
            }
        }
Exemple #2
0
 public override void Serialize(string obj, Stream stream)
 {
     SimpleStreamUtil.Write(stream, obj);
 }
Exemple #3
0
 public override void Serialize(byte[] obj, Stream stream)
 {
     SimpleStreamUtil.Write(stream, obj.Length);
     SimpleStreamUtil.Write(stream, obj);
 }