Ejemplo n.º 1
0
        public static void WriteInt16(short value, MsgPackStream stream)
        {
            if (value >= 0)
            {
                WriteUInt16(unchecked ((ushort)value), stream);
                return;
            }

            if (value >= sbyte.MinValue)
            {
                WriteInt8(unchecked ((sbyte)value), stream);
                return;
            }

            stream.WriteUInt8(FormatCode.Int16);
            stream.WriteInt16(value);
        }