VIMediaCacheWorker.h 879 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // VIMediaCacheWorker.h
  3. // VIMediaCacheDemo
  4. //
  5. // Created by Vito on 4/21/16.
  6. // Copyright © 2016 Vito. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "VICacheConfiguration.h"
  10. @class VICacheAction;
  11. @interface VIMediaCacheWorker : NSObject
  12. - (instancetype)initWithURL:(NSURL *)url;
  13. @property (nonatomic, strong, readonly) VICacheConfiguration *cacheConfiguration;
  14. @property (nonatomic, strong, readonly) NSError *setupError; // Create fileHandler error, can't save/use cache
  15. - (void)cacheData:(NSData *)data forRange:(NSRange)range error:(NSError **)error;
  16. - (NSArray<VICacheAction *> *)cachedDataActionsForRange:(NSRange)range;
  17. - (NSData *)cachedDataForRange:(NSRange)range error:(NSError **)error;
  18. - (void)setContentInfo:(VIContentInfo *)contentInfo error:(NSError **)error;
  19. - (void)save;
  20. - (void)startWritting;
  21. - (void)finishWritting;
  22. @end