public static void WriteLong(this IBufferWriter <byte> writer, long value)
        {
            if (value <= sbyte.MaxValue && value >= sbyte.MinValue)
            {
                writer.WriteByteValueAndAdvance(TypeCodes.SmallLong, (byte)value);
                return;
            }

            BinaryPrimitives.WriteInt64BigEndian(GetSpanForValue(writer, TypeCodes.Long, sizeof(long)), value);
            writer.Advance(sizeof(long) + 1);
        }
        public static void WriteInt(this IBufferWriter <byte> writer, int value)
        {
            if (value >= sbyte.MinValue && value <= sbyte.MaxValue)
            {
                writer.WriteByteValueAndAdvance(TypeCodes.SmallInt, (byte)value);
                return;
            }

            BinaryPrimitives.WriteInt32BigEndian(GetSpanForValue(writer, TypeCodes.Int, sizeof(int)), value);
            writer.Advance(sizeof(int) + 1);
        }
        public static void WriteULong(this IBufferWriter <byte> writer, ulong value)
        {
            if (value == 0)
            {
                writer.WriteCodeAndAdvance(TypeCodes.ULong0);
                return;
            }

            if (value <= byte.MaxValue)
            {
                writer.WriteByteValueAndAdvance(TypeCodes.SmallULong, (byte)value);
                return;
            }

            BinaryPrimitives.WriteUInt64BigEndian(GetSpanForValue(writer, TypeCodes.ULong, sizeof(ulong)), value);
            writer.Advance(sizeof(ulong) + 1);
        }
 public static void WriteByte(this IBufferWriter <byte> writer, sbyte value) => writer.WriteByteValueAndAdvance(TypeCodes.Byte, (byte)value);
 public static void WriteBoolean(this IBufferWriter <byte> writer, bool value) => writer.WriteByteValueAndAdvance(TypeCodes.Boolean, Convert.ToByte(value));