Extension of java.io.InputStream for reading data from the secure file system. More...
This class is a subclass of java.i
o.InputStream
for reading data from the BlackBerry Dynamics secure file system.
See the com.good.gd.file package documentation for an introduction to the secure file system.
This class has the same programming interface as the java.i
o.FileInputStream
class, which inherits from java.i
o.InputStream
, with the following exceptions.
FileChannel
isn't supported. There is no getChannel
method.FileDescriptor
isn't supported. There is no getFD
method. There is no constructor to create a stream from a descriptor.
The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.
/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
Public Member Functions | |
FileInputStream (String name) throws FileNotFoundException | |
Constructor that opens a file for reading, from a String containing the path in the secure store. More... | |
FileInputStream (File file) throws FileNotFoundException | |
Constructor that opens a file for reading, from a File containing the path in the secure store. More... | |
int | available () throws IOException |
Check how many bytes are available on an open file in the secure store. More... | |
int | read () throws IOException |
Read one byte from a file in the secure store. More... | |
int | read (byte[] b) throws IOException |
Fill a byte buffer with data read from a file in the secure store. More... | |
int | read (byte[] b, int off, int len) throws IOException |
Read a specified amount of data from a file in the secure store into a byte buffer, at a specified offset. More... | |
long | skip (long n) throws IOException |
Read and discard a number of bytes from an open file in the secure store. More... | |
void | close () throws IOException |
Close a file in the secure store. More... | |
void | mark (int readlimit) |
Mark the current position of an open file in the secure store, for later reset . More... | |
void | reset () throws IOException |
Reset an open file in the secure store to the position of an earlier mark . More... | |
boolean | markSupported () |
Test whether an open file in the secure store supports mark and reset ; always true . More... | |
FileInputStream | ( | String | name | ) | throws FileNotFoundException |
Call this constructor to open a file in the secure store, for reading.
name | String containing the path of the file to open, in the secure file system. |
FileNotFoundException | |
com.good.gd.error.GDNotAuthorizedError | if BlackBerry Dynamics authorization processing has not yet completed. |
FileInputStream | ( | File | file | ) | throws FileNotFoundException |
Call this constructor to open a file in the secure store, for reading.
file | File containing the path of the file to open, in the secure file system. |
FileNotFoundException | |
com.good.gd.error.GDNotAuthorizedError | if BlackBerry Dynamics authorization processing has not yet completed. |
int available | ( | ) | throws IOException |
int
representation of the number of bytes currently available to read.IOException |
int read | ( | ) | throws IOException |
Call this method to read one byte from an open file in the secure store.
int
representation of the next byte of data, or -1 if the end of the file has been reached.IOException |
int read | ( | byte[] | b | ) | throws IOException |
Call this method to read data from a file in the secure store into a byte buffer. No more data will be read than can be stored in the buffer.
b | byte array into which data will be read. |
int
representation of the number of bytes actually read, or -1 if the end of the file has been reached.IOException |
int read | ( | byte[] | b, |
int | off, | ||
int | len | ||
) | throws IOException |
Call this method to read data from a file in the secure store into a byte buffer. The data that is read will be written into the buffer starting at a specified offset. No more data will be read than a specified maximum.
b | byte array for the buffer into which data will be written. |
off | int offset into the buffer, at which writing is to begin. |
len | int maximum number of bytes to read. |
int
representation of the number of bytes actually read, or -1 if the end of the file has been reached.IOException |
long skip | ( | long | n | ) | throws IOException |
n | long specifying how many bytes to skip. |
long
representation of the number of bytes actually skipped.IOException |
void close | ( | ) | throws IOException |
Call this method to close an open file in the secure store. Any resources associated with the open file's stream will be released.
IOException |
void mark | ( | int | readlimit | ) |
Call this method to mark the current position of an open file in the secure store. This enables a later call to reset. The reset
call must take place before a specified amount of data has been read from the stream.
readlimit | int specifying the amount of data that can be read in between the call to this method and the subsequent call to reset . |
IOException |
void reset | ( | ) | throws IOException |
Call this method to reset an open file in the secure store to the position of an earlier call to mark.
This method will throw an IOException
if there was no earlier call to mark
, or if the specified readlimit
has been passed.
IOException |