System.Buffer.ByteLength C# (CSharp) Méthode

ByteLength() private méthode

private ByteLength ( Array array ) : int
array Array
Résultat int
        public static extern int ByteLength(Array array);

Usage Example

 /// <summary>Assigns a specified value to a byte at a particular location in a specified array.</summary>
 /// <param name="array">An array. </param>
 /// <param name="index">A location in the array. </param>
 /// <param name="value">A value to assign. </param>
 /// <exception cref="T:System.ArgumentException">
 ///   <paramref name="array" /> is not a primitive. </exception>
 /// <exception cref="T:System.ArgumentNullException">
 ///   <paramref name="array" /> is null. </exception>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 ///   <paramref name="index" /> is negative or greater than the length of <paramref name="array" />. </exception>
 /// <filterpriority>1</filterpriority>
 public static void SetByte(Array array, int index, byte value)
 {
     if (index < 0 || index >= Buffer.ByteLength(array))
     {
         throw new ArgumentOutOfRangeException("index", Locale.GetText("Value must be non-negative and less than the size of the collection."));
     }
     Buffer.SetByteInternal(array, index, (int)value);
 }
All Usage Examples Of System.Buffer::ByteLength