ZDCInterruptingInputStream

@interface ZDCInterruptingInputStream : ZDCInputStream <NSCopying>

ZDCInterruptingInputStream will automatically close itself with an error if it detects the underlying file was modified.

It can be used to safely stream a file directly from disk, which may be modified by other processes on the OS.

  • Use this method instead of the usual NSInputStream init methods. The compiler gets mad when we try to override those…

    Declaration

    Objective-C

    - (instancetype)initWithFileURL:(NSURL *)fileURL;

    Swift

    init!(fileURL: URL!)
  • The fileURL parameter used to initialize the stream.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSURL *fileURL;

    Swift

    var fileURL: URL! { get }
  • The size of the underlying file (in bytes) (value is wrapped uint64_t). Another way to think of it: it will be the output of all read:maxLength: invocations.

    This value is available anytime after the stream has been opened.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSNumber *fileSize;

    Swift

    var fileSize: NSNumber! { get }