/// <summary>Retrieves the byte at a specified location in a specified array.</summary> /// <returns>Returns the <paramref name="index" /> byte in the array.</returns> /// <param name="array">An array. </param> /// <param name="index">A location in the array. </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 byte GetByte(Array array, int index) { 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.")); } return(Buffer.GetByteInternal(array, index)); }