private static CheckByteArgument ( byte value, int startIndex, int bytesRequired ) : void | ||
value | byte | Specify the byte array. |
startIndex | int | Specify the start index. |
bytesRequired | int | Specify the number of bytes. |
return | void |
private static void CheckByteArgument(byte[] value, int startIndex, int bytesRequired)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
if (startIndex < 0)
{
throw new ArgumentException("The index cannot be less than 0.");
}
if (startIndex > value.Length - bytesRequired)
{
throw new ArgumentOutOfRangeException("startIndex");
}
}
}