I read about ParcelFileDescriptor
from below link.
http://developer.android.com/reference/android/os/ParcelFileDescriptor.html
but I haven't got any idea from it. What is it? and What can it do?
Can anyone explain me?
What it is?
A file descriptor is an object that a process uses to read or write to an open file and open network sockets.
FileDescriptor
objects, representing raw Linux file descriptor identifiers, can be written and ParcelFileDescriptor
objects returned to operate on the original file descriptor. The returned file descriptor is a dup of the original file descriptor: the object and fd is different, but operating on the same underlying file stream, with the same position.
and What can it do?
Create pipes, create fds from sockets, open/close files.
It implements the Parcable API, which allow put it into Bundles and Intents. It may be even possible to send a FileDescriptor between process. (I have not tested this).
Also the VPNService gives you a ParcelFileDescriptor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With