Extension of java.io.OutputStream for writing data to the secure file system. More...
This class is a subclass of java.i
o.OutputStream
for writing data to 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.FileOutputStream
class, which inherits from java.i
o.OutputStream
, 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.flush
method has no effect.
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 | |
FileOutputStream (File file) throws FileNotFoundException | |
Constructor that opens a file for writing, from a File containing the path in the secure store. More... | |
FileOutputStream (File file, boolean append) throws FileNotFoundException | |
Constructor that opens a file for writing in overwrite or append mode, from a File containing the path in the secure store. More... | |
FileOutputStream (String path) throws FileNotFoundException | |
Constructor that opens a file for writing, from a String containing the path in the secure store. More... | |
FileOutputStream (String path, boolean append) throws FileNotFoundException | |
Constructor that opens a file for writing in overwrite or append mode, from a String containing the path in the secure store. More... | |
void | write (int b) throws IOException |
Write one byte to an open file in the secure store. More... | |
void | write (byte[] b) throws IOException |
Write a byte buffer to an open file in the secure store. More... | |
void | write (byte[] b, int off, int len) throws IOException |
Write a specified amount of data, from a specified offset into a byte buffer, into an open file in the secure store. More... | |
void | flush () throws IOException |
Flush an open file in the secure store. More... | |
void | close () throws IOException |
Close a file in the secure store. More... | |
FileOutputStream | ( | File | file | ) | throws FileNotFoundException |
Call this constructor to open a file in the secure store, for writing. If there is already a file at the specified path, the file is truncated.
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. |
FileOutputStream | ( | File | file, |
boolean | append | ||
) | throws FileNotFoundException |
Call this constructor to open a file in the secure store, for writing. If a file already exists at the specified path, the file can either be appended to, or overwritten.
file | File containing the path of the file to open, in the secure file system. |
append | boolean Selects the action to take if a file already exists at the path: true to append to the file, or false to overwrite. |
FileNotFoundException | |
com.good.gd.error.GDNotAuthorizedError | if BlackBerry Dynamics authorization processing has not yet completed. |
FileOutputStream | ( | String | path | ) | throws FileNotFoundException |
Call this constructor to open a file in the secure store, for writing. If there is already a file at the specified path, the file is truncated.
path | 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. |
FileOutputStream | ( | String | path, |
boolean | append | ||
) | throws FileNotFoundException |
Call this constructor to open a file in the secure store, for writing. If a file already exists at the specified path, the file can either be appended to, or overwritten.
path | String containing the path of the file to open, in the secure file system. |
append | boolean Selects the action to take if a file already exists at the path: true to append to the file, or false to overwrite. |
FileNotFoundException | |
com.good.gd.error.GDNotAuthorizedError | if BlackBerry Dynamics authorization processing has not yet completed. |
void write | ( | int | b | ) | throws IOException |
b | int representation of the byte to write to the open file, in the secure store. |
IOException |
void write | ( | byte[] | b | ) | throws IOException |
b | byte array to write to the open file, in the secure store. |
IOException |
void write | ( | byte[] | b, |
int | off, | ||
int | len | ||
) | throws IOException |
Call this method to write data from a byte buffer into a file in the secure store. The data will be read from the buffer, starting at a specified offset.
b | byte array for the buffer from which data will be read. |
off | int offset into the buffer, from which reading is to begin. |
len | int maximum number of bytes to write. |
IOException |
void flush | ( | ) | throws IOException |
The secure file system doesn't support separate flushing and closing of files. Calling this method has no effect.
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. Data that is pending write will be committed to the secure store.
Calling this method is the only way to confirm finalisation of writing data to the secure file system.