• BlackBerry Dynamics
  • Runtime library for iOS applications
GDCWriteStream Class Reference

NSOutputStream subclass for writing files in the secure store. More...

#import <GDCWriteStream.h>

Inheritance diagram for GDCWriteStream:


This class is a subclass of the native NSInputStream class, for access to the BlackBerry Dynamics secure file system.

See also

Programming Interface

The class supports the write and hasSpaceAvailable member functions of NSOutputStream. The subclass doesn't support scheduleInRunLoop nor removeFromRunLoop. Support for run loops isn't required because the file data can be written immediately.

This documentation includes only additional operations provided by GDCWriteStream that are not part of NSOutputStream.

The functions in this class utilize NSError in a conventional way. Function calls accept as a parameter the location of a pointer to NSError, i.e. a pointer to a pointer, with type NSError**. The location may be nil. If the location isn't nil, and an error occurs, the BlackBerry Dynamics runtime overwrites the pointer at the specified location with the address of an object that describes the error that occurred.

See also
NSOutputStream class reference on the apple.com developer website.

Instance Methods

(instancetype) - initWithFile:append:error:
 Constructor that opens or creates a file in the secure store, for writing. More...
(instancetype) - initWithFile:append:
 Constructor that opens or creates a file in the secure store, for writing. More...
(NSError *) - streamError
 Get the last error. More...

Method Documentation

◆ initWithFile:append:error:

- (instancetype) initWithFile: (NSString *)  filePath
append: (BOOL)  shouldAppend
error: (NSError **)  error 

Call this constructor to create a new file in the secure store, or to open an existing file for writing. Files in the secure store are encrypted on the device; data written to the stream returned by this function will be encrypted, transparently to the application.

If a file already exists at the specified path, the file can either be appended to, or overwritten.

Note. This constructor is used by the getWriteStream: function in the GDFileManager class.

filePathNSString containing the path, within the secure store, of the file to be opened.
shouldAppendSelects the action to take if a file already exists at the path: YES to append to the file, or NO to overwrite.
errorFor returning an NSError object if an error occurs. If nil, no object will be returned.
nil if the file couldn't be opened.

◆ initWithFile:append:

- (instancetype) initWithFile: (NSString *)  filePath
append: (BOOL)  shouldAppend 

Calling this constructor is equivalent to calling the initWithFile:append:error: constructor, above, and specifying nil as the error parameter.

◆ streamError

- (NSError*) streamError

Call this function to get the last error associated with the open stream.

Reference to an NSError object that describes the error.
See also
GDFileManager Error Domain

The documentation for this class was generated from the following file: