NSInputStream subclass for reading files that are in the secure store. More...
#include <BlackBerryDynamics/GD/GDCReadStream.h>
Inherits NSInputStream, and <NSStreamDelegate>.
This class is a subclass of the native NSInputStream class, for access to the BlackBerry Dynamics secure file system.
This class supports the read and hasBytesAvailable member functions of NSInputStream. This class doesn't support getBuffer, which will always return NO. This class also doesn't support scheduleInRunLoop nor removeFromRunLoop. Support for run loops isn't required because the file data can be read immediately.
This documentation includes only additional operations provided by GDCReadStream that aren't part of NSInputStream.
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.
Instance Methods | |
| (instancetype) | - initWithFile:error: |
| Constructor that opens a file in the secure store, for reading. | |
| (instancetype) | - initWithFile: |
| Constructor that opens a file in the secure store, for reading. | |
| (BOOL) | - seekToFileOffset: |
| Seek in an open file in the secure file system. | |
| (NSError *) | - streamError |
| Get the last error. | |
| - (instancetype) initWithFile: | (NSString *) | filePath | |
| error: | (NSError **) | error |
Call this constructor to open a file in the secure store for reading. Files in the secure store are encrypted on the device; this function provides access to decrypted data.
Note. This constructor is used by the getReadStream: function in the GDFileManager class.
| filePath | NSString containing the path, within the secure store, of the file to be opened. |
| error | For returning an NSError object if an error occurs. If nil, no object will be returned. |
| - (instancetype) initWithFile: | (NSString *) | filePath |
Calling this constructor is equivalent to calling the initWithFile:error: constructor, above, and specifying nil as the error parameter.
| - (BOOL) seekToFileOffset: | (unsigned long long) | offset |
Call this function to move the file pointer to a specific offset from the start of the stream.
| offset | Required offset, expressed as a number of bytes from the start of the file. Zero means the start of the file. |
| - (NSError *) streamError |
Call this function to get the last error associated with the open stream.