Compartir a través de


ParcelFileDescriptor.AdoptFd(Int32) Method

Definition

Take ownership of a raw native fd in to a new ParcelFileDescriptor.

[Android.Runtime.Register("adoptFd", "(I)Landroid/os/ParcelFileDescriptor;", "")]
public static Android.OS.ParcelFileDescriptor? AdoptFd (int fd);
[<Android.Runtime.Register("adoptFd", "(I)Landroid/os/ParcelFileDescriptor;", "")>]
static member AdoptFd : int -> Android.OS.ParcelFileDescriptor

Parameters

fd
Int32

The native fd that the ParcelFileDescriptor should adopt.

Returns

Returns a new ParcelFileDescriptor holding a FileDescriptor for the given fd.

Attributes

Remarks

Take ownership of a raw native fd in to a new ParcelFileDescriptor. The returned ParcelFileDescriptor now owns the given fd, and will be responsible for closing it.

<strong>WARNING:</strong> You must not close the fd yourself after this call, and ownership of the file descriptor must have been released prior to the call to this function.

Java documentation for android.os.ParcelFileDescriptor.adoptFd(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to