public static int ByteLength(Array array) { if (array == null) { throw new ArgumentNullException("array"); } if (!Buffer.IsPrimitiveTypeArray(array)) { throw new ArgumentException(Environment.GetResourceString("Arg_MustBePrimArray"), "array"); } return(Buffer._ByteLength(array)); }
public static void SetByte(Array array, int index, byte value) { if (array == null) { throw new ArgumentNullException("array"); } if (!Buffer.IsPrimitiveTypeArray(array)) { throw new ArgumentException(Environment.GetResourceString("Arg_MustBePrimArray"), "array"); } if (index < 0 || index >= Buffer._ByteLength(array)) { throw new ArgumentOutOfRangeException("index"); } Buffer._SetByte(array, index, value); }