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; } }
public override void Serialize(string obj, Stream stream) { SimpleStreamUtil.Write(stream, obj); }
public override void Serialize(byte[] obj, Stream stream) { SimpleStreamUtil.Write(stream, obj.Length); SimpleStreamUtil.Write(stream, obj); }