异常处理情况

public void Update(byte[] buffer)
  {
   if ( buffer == null ) {
    throw new ArgumentNullException("buffer");  //判断参数为空,抛出异常,而非try catch捕获
   }

   Update(buffer, 0, buffer.Length);
  }

 

posted @ 2014-05-23 15:10  长白山  阅读(85)  评论(0编辑  收藏  举报