コード例 #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;
            }
        }
コード例 #2
0
 public override void Serialize(string obj, Stream stream)
 {
     SimpleStreamUtil.Write(stream, obj);
 }
コード例 #3
0
 public override void Serialize(byte[] obj, Stream stream)
 {
     SimpleStreamUtil.Write(stream, obj.Length);
     SimpleStreamUtil.Write(stream, obj);
 }