예제 #1
0
 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));
 }
예제 #2
0
 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);
 }