System.Runtime.Serialization.Plists.BinaryPlistItem.SetByteValue C# (CSharp) Method

SetByteValue() public method

Sets the ByteValue to the given collection.
public SetByteValue ( IEnumerable buffer ) : void
buffer IEnumerable The collection to set.
return void
        public void SetByteValue(IEnumerable<byte> buffer)
        {
            this.byteValue.Clear();

            if (buffer != null)
            {
                this.byteValue.AddRange(buffer);
            }
        }

Usage Example

コード例 #1
0
        /// <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));
        }
All Usage Examples Of System.Runtime.Serialization.Plists.BinaryPlistItem::SetByteValue