blackberry.com
BlackBerry Dynamics
Runtime library for iOS applications
from the application developer portal
Public Member Functions

GDCWriteStream Class Reference

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

#import <GDCWriteStream.h>

List of all members.

Public Member Functions


Detailed Description

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

See also:
GDFileManager
GDFileHandle

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.
GDCReadStream

Member Function Documentation

- (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.

Parameters:
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.
Returns:
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.

Returns:
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: