using System; using ProtoBuf.Meta; namespace ProtoBuf.Serializers { internal sealed class SByteSerializer : IProtoSerializer { public Type ExpectedType { get { return SByteSerializer.expectedType; } } bool IProtoSerializer.RequiresOldValue { get { return false; } } bool IProtoSerializer.ReturnsValue { get { return true; } } private static readonly Type expectedType = typeof(sbyte); public SByteSerializer(TypeModel model) { } public object Read(object value, ProtoReader source) { Helpers.DebugAssert(value == null); return source.ReadSByte(); } public void Write(object value, ProtoWriter dest) { ProtoWriter.WriteSByte((sbyte)value, dest); } } }