text: //
  //  SURequestTask.h
  //  SULoader
  //
  //  Created by 万众科技 on 16/6/28.
  //  Copyright © 2016年 万众科技. All rights reserved.
  //
  
  #import <Foundation/Foundation.h>
  #import "SUFileHandle.h"
  
  #define RequestTimeout 10.0
  
  @class SURequestTask;
  @protocol SURequestTaskDelegate <NSObject>
  
  @required
  - (void)requestTaskDidUpdateCache; //更新缓冲进度代理方法
  
  @optional
  - (void)requestTaskDidReceiveResponse;
  - (void)requestTaskDidFinishLoadingWithCache:(BOOL)cache;
  - (void)requestTaskDidFailWithError:(NSError *)error;
  
  @end
  
  @interface SURequestTask : NSObject
  
  @property (nonatomic, weak) id<SURequestTaskDelegate> delegate;
  @property (nonatomic, strong) NSURL * requestURL; //请求网址
  @property (nonatomic, assign) NSUInteger requestOffset; //请求起始位置
  @property (nonatomic, assign) NSUInteger fileLength; //文件长度
  @property (nonatomic, assign) NSUInteger cacheLength; //缓冲长度
  @property (nonatomic, assign) BOOL cache; //是否缓存文件
  @property (nonatomic, assign) BOOL cancel; //是否取消请求
  
  /**
   *  开始请求
   */
  - (void)start;
  
  @end
  