Lines Matching refs:fd

117         FileDescriptor fd = Parcel.openFileDescriptor(path, mode);
118 return fd != null ? new ParcelFileDescriptor(fd) : null;
128 FileDescriptor fd = Parcel.dupFileDescriptor(orig);
129 return fd != null ? new ParcelFileDescriptor(fd) : null;
143 * Create a new ParcelFileDescriptor from a raw native fd. The new
144 * ParcelFileDescriptor holds a dup of the original fd passed in here,
145 * so you must still close that fd as well as the new ParcelFileDescriptor.
147 * @param fd The native fd that the ParcelFileDescriptor should dup.
150 * for a dup of the given fd.
152 public static ParcelFileDescriptor fromFd(int fd) throws IOException {
153 FileDescriptor fdesc = getFileDescriptorFromFd(fd);
158 private static native FileDescriptor getFileDescriptorFromFd(int fd) throws IOException;
161 * Take ownership of a raw native fd in to a new ParcelFileDescriptor.
162 * The returned ParcelFileDescriptor now owns the given fd, and will be
163 * responsible for closing it. You must not close the fd yourself.
165 * @param fd The native fd that the ParcelFileDescriptor should adopt.
168 * for the given fd.
170 public static ParcelFileDescriptor adoptFd(int fd) {
171 FileDescriptor fdesc = getFileDescriptorFromFdNoDup(fd);
176 private static native FileDescriptor getFileDescriptorFromFdNoDup(int fd);
191 FileDescriptor fd = socket.getFileDescriptor$();
192 return fd != null ? new ParcelFileDescriptor(fd) : null;
205 FileDescriptor fd = datagramSocket.getFileDescriptor$();
206 return fd != null ? new ParcelFileDescriptor(fd) : null;
243 FileDescriptor fd = file.getFileDescriptor();
244 return fd != null ? new ParcelFileDescriptor(fd) : null;
257 * Return the total size of the file representing this fd, as determined
258 * by stat(). Returns -1 if the fd is not a file.
270 * Return the native fd int for this ParcelFileDescriptor. The
271 * ParcelFileDescriptor still owns the fd, and it still must be closed
284 * Return the native fd int for this ParcelFileDescriptor and detach it
285 * from the object here. You are now responsible for closing the fd in
293 int fd = mWrapped.detachFd();
296 return fd;
298 int fd = getFd();
302 return fd;
335 public AutoCloseInputStream(ParcelFileDescriptor fd) {
336 super(fd.getFileDescriptor());
337 mFd = fd;
358 public AutoCloseOutputStream(ParcelFileDescriptor fd) {
359 super(fd.getFileDescriptor());
360 mFd = fd;