android.os.ParcelFileDescriptor
The FileDescriptor returned by readFileDescriptor(), allowing
you to close it when done with it.
Nested Classes
Summary
Constants
Public Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Constants
public
static
final
int
MODE_CREATE
For use with
open(File, int): create the file if it doesn't already exist.
Constant Value:
134217728
(0x08000000)
public
static
final
int
MODE_READ_ONLY
For use with
open(File, int): open the file with read-only access.
Constant Value:
268435456
(0x10000000)
public
static
final
int
MODE_READ_WRITE
For use with
open(File, int): open the file with read and write access.
Constant Value:
805306368
(0x30000000)
public
static
final
int
MODE_TRUNCATE
For use with
open(File, int): erase contents of file when opening.
Constant Value:
67108864
(0x04000000)
public
static
final
int
MODE_WORLD_READABLE
For use with
open(File, int): if
MODE_CREATE has been supplied
and this file doesn't already exist, then create the file with
permissions such that any application can read it.
Constant Value:
1
(0x00000001)
public
static
final
int
MODE_WORLD_WRITEABLE
For use with
open(File, int): if
MODE_CREATE has been supplied
and this file doesn't already exist, then create the file with
permissions such that any application can write it.
Constant Value:
2
(0x00000002)
public
static
final
int
MODE_WRITE_ONLY
For use with
open(File, int): open the file with write-only access.
Constant Value:
536870912
(0x20000000)
Public Constructors
Public Methods
public
void
close()
Close the ParcelFileDescriptor. This implementation closes the underlying
OS resources allocated to represent this stream.
Throws
IOException
| If an error occurs attempting to close this ParcelFileDescriptor.
|
public
int
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
Create a new ParcelFileDescriptor from the specified Socket.
Parameters
socket
| The Socket whose FileDescriptor is used to create
a new ParcelFileDescriptor. |
Returns
- A new ParcelFileDescriptor with the FileDescriptor of the
specified Socket.
Retrieve the actual FileDescriptor associated with this object.
Returns
- Returns the FileDescriptor associated with this object.
Create a new ParcelFileDescriptor accessing a given file.
Returns
- Returns a new ParcelFileDescriptor pointing to the given
file.
Throws
FileNotFoundException
| Throws FileNotFoundException if the given
file does not exist or can not be opened with the requested mode.
|
public
String
toString()
Returns a string containing a concise, human-readable description of the
receiver.
Returns
- String a printable representation for the receiver.
public
void
writeToParcel(Parcel out, int flags)
Flatten this object in to a Parcel.
Protected Methods
protected
void
finalize()
Called by the virtual machine when there are no longer any (non-weak)
references to the receiver. Subclasses can use this facility to guarantee
that any associated resources are cleaned up before the receiver is
garbage collected. Uncaught exceptions which are thrown during the
running of the method cause it to terminate immediately, but are
otherwise ignored.
Note: The virtual machine assumes that the implementation in class Object
is empty.