NSOutputStream subclass for writing files in the secure store. More...
#import <GDCWriteStream.h>
This class is a subclass of the native NSInputStream
class, for access to the BlackBerry Dynamics secure file system.
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 is not 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.
- (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.
filePath | NSString containing the path, within the secure store, of the file to be opened. |
shouldAppend | Selects the action to take if a file already exists at the path: YES to append to the file, or NO to overwrite. |
error | For returning an NSError object if an error occurs. If nil , no object will be returned. |
nil
if the file couldn't be opened. - (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.
- (NSError*) streamError |
Call this function to get the last error associated with the open stream.
NSError
object that describes the error.