public void Write(sbyte value, IMsgPackWriter writer, MsgPackContext context) { switch (value.GetFormatType()) { case DataTypes.PositiveFixNum: WritePositiveFixNum((byte)value, writer); break; case DataTypes.NegativeFixNum: WriteNegativeFixNum(value, writer); break; case DataTypes.UInt8: WriteMPackValue((byte)value, writer); break; case DataTypes.Int8: WriteMPackValue(value, writer); break; default: throw new ArgumentOutOfRangeException(); } }