Udostępnij za pośrednictwem


FileUtils.CloseQuietly Method

Definition

Overloads

CloseQuietly(FileDescriptor)

Closes the given object quietly, ignoring any checked exceptions.

CloseQuietly(IAutoCloseable)

Closes the given object quietly, ignoring any checked exceptions.

CloseQuietly(FileDescriptor)

Closes the given object quietly, ignoring any checked exceptions.

[Android.Runtime.Register("closeQuietly", "(Ljava/io/FileDescriptor;)V", "", ApiSince=29)]
public static void CloseQuietly (Java.IO.FileDescriptor? fd);
[<Android.Runtime.Register("closeQuietly", "(Ljava/io/FileDescriptor;)V", "", ApiSince=29)>]
static member CloseQuietly : Java.IO.FileDescriptor -> unit

Parameters

Attributes

Remarks

Closes the given object quietly, ignoring any checked exceptions. Does nothing if the given object is null.

This member is deprecated. This method may suppress potentially significant exceptions, particularly when closing writable resources. With a writable resource, a failure thrown from close() should be considered as significant as a failure thrown from a write method because it may indicate a failure to flush bytes to the underlying resource.

Java documentation for android.os.FileUtils.closeQuietly(java.io.FileDescriptor).

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

CloseQuietly(IAutoCloseable)

Closes the given object quietly, ignoring any checked exceptions.

[Android.Runtime.Register("closeQuietly", "(Ljava/lang/AutoCloseable;)V", "", ApiSince=29)]
public static void CloseQuietly (Java.Lang.IAutoCloseable? closeable);
[<Android.Runtime.Register("closeQuietly", "(Ljava/lang/AutoCloseable;)V", "", ApiSince=29)>]
static member CloseQuietly : Java.Lang.IAutoCloseable -> unit

Parameters

closeable
IAutoCloseable
Attributes

Remarks

Closes the given object quietly, ignoring any checked exceptions. Does nothing if the given object is null.

This member is deprecated. This method may suppress potentially significant exceptions, particularly when closing writable resources. With a writable resource, a failure thrown from close() should be considered as significant as a failure thrown from a write method because it may indicate a failure to flush bytes to the underlying resource.

Java documentation for android.os.FileUtils.closeQuietly(java.lang.AutoCloseable).

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