ASIInputStream.h 969 B

1234567891011121314151617181920212223242526
  1. //
  2. // ASIInputStream.h
  3. // Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest
  4. //
  5. // Created by Ben Copsey on 10/08/2009.
  6. // Copyright 2009 All-Seeing Interactive. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class ASIHTTPRequest;
  10. // This is a wrapper for NSInputStream that pretends to be an NSInputStream itself
  11. // Subclassing NSInputStream seems to be tricky, and may involve overriding undocumented methods, so we'll cheat instead.
  12. // It is used by ASIHTTPRequest whenever we have a request body, and handles measuring and throttling the bandwidth used for uploading
  13. @interface ASIInputStream : NSObject {
  14. NSInputStream *stream;
  15. ASIHTTPRequest *request;
  16. }
  17. + (id)inputStreamWithFileAtPath:(NSString *)path request:(ASIHTTPRequest *)request;
  18. + (id)inputStreamWithData:(NSData *)data request:(ASIHTTPRequest *)request;
  19. @property (retain, nonatomic) NSInputStream *stream;
  20. @property (assign, nonatomic) ASIHTTPRequest *request;
  21. @end