Lines Matching refs:mode
103 * There are no guarantees that this access mode will remain on
119 * There are no guarantees that this access mode will remain on
188 * @param mode The desired access mode, must be one of
196 * be opened with the requested mode.
199 public static ParcelFileDescriptor open(File file, int mode) throws FileNotFoundException {
200 final FileDescriptor fd = openInternal(file, mode);
210 * @param mode The desired access mode, must be one of
221 * be opened with the requested mode.
224 public static ParcelFileDescriptor open(File file, int mode, Handler handler,
233 final FileDescriptor fd = openInternal(file, mode);
263 private static FileDescriptor openInternal(File file, int mode) throws FileNotFoundException {
264 if ((mode & MODE_READ_WRITE) == 0) {
270 return Parcel.openFileDescriptor(path, mode);
503 * Converts a string representing a file mode, such as "rw", into a bitmask suitable for use
506 * @param mode The string representation of the file mode.
507 * @return A bitmask representing the given file mode.
508 * @throws IllegalArgumentException if the given string does not match a known file mode.
510 public static int parseMode(String mode) {
512 if ("r".equals(mode)) {
514 } else if ("w".equals(mode) || "wt".equals(mode)) {
518 } else if ("wa".equals(mode)) {
522 } else if ("rw".equals(mode)) {
525 } else if ("rwt".equals(mode)) {
530 throw new IllegalArgumentException("Bad mode '" + mode + "'");