/// <summary>
/// Adds a float to the internal object table.
/// </summary>
/// <param name="value">The value to add.</param>
/// <returns>The index of the added value.</returns>
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));
}