NSData+NSInputStream.h 612 B

1234567891011121314151617181920
  1. //
  2. // NSData+NSInputStream.h
  3. // Tidbits
  4. //
  5. // Created by Ewan Mellor on 6/16/13.
  6. // Copyright (c) 2013 Tipbit, Inc. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface NSData (NSInputStream)
  10. /**
  11. * @param capacity May be NSUIntegerMax, in which case just an ordinary [NSMutableData data] is used. Otherwise this is given to NSMutableData dataWithCapacity:].
  12. * @param error May be nil.
  13. * @return The data or nil on failure in which case *error will be set.
  14. */
  15. +(NSData*)dataWithContentsOfStream:(NSInputStream*)input initialCapacity:(NSUInteger)capacity error:(NSError **)error;
  16. @end