System.Runtime.Serialization.Plists.BinaryPlistWriter.AddFloat C# (CSharp) Method

AddFloat() private method

Adds a float to the internal object table.
private AddFloat ( float value ) : int
value float The value to add.
return int
        private int AddFloat(float value)
        {
            if (!this.uniques.Contains(value))
            {
                int index = this.objectTable.Count;
                byte[] buffer = BitConverter.GetBytes(value);

                if (BitConverter.IsLittleEndian)
                {
                    Array.Reverse(buffer);
                }

                BinaryPlistItem item = new BinaryPlistItem(value);
                item.Marker.Add((byte)((byte)0x20 | (byte)Math.Log(buffer.Length, 2)));
                item.SetByteValue(buffer);

                this.objectTable.Add(item);
                this.objectTableSize += item.Size;

                this.uniques.SetIndex(value, index);
                return index;
            }

            return this.uniques.GetIndex(value);
        }