鴻蒙OS ReliableFileDescriptor.AutoCloseFileOutputStream

2022-04-27 16:36 更新

ReliableFileDescriptor.AutoCloseFileOutputStream

java.lang.Object

|---java.io.OutputStream

|---|---java.io.FileOutputStream

|---|---|---ohos.rpc.ReliableFileDescriptor.AutoCloseFileOutputStream

public static class ReliableFileDescriptor.AutoCloseFileOutputStream
extends FileOutputStream

表示一個(gè)文件輸出流,其文件描述符在此流關(guān)閉時(shí)自動(dòng)關(guān)閉。

此類僅適用于同一設(shè)備上的操作。

構(gòu)造函數(shù)摘要

構(gòu)造函數(shù) 描述
AutoCloseFileOutputStream(ReliableFileDescriptor reliablefd) 用于使用 ReliableFileDescriptor 對象創(chuàng)建 AutoCloseFileOutputStream 實(shí)例的構(gòu)造函數(shù)。

方法總結(jié)

修飾符和類型 方法 描述
void close() 關(guān)閉此 AutoCloseFileOutputStream 對象,其 ReliableFileDescriptor 對象也會自動(dòng)關(guān)閉。
從類 java.io.FileOutputStream 繼承的方法
finalize, getChannel, getFD, write, write, write
從類 java.lang.Object 繼承的方法
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
從類 java.io.OutputStream 繼承的方法
flush

構(gòu)造函數(shù)詳細(xì)信息

AutoCloseFileOutputStream

public AutoCloseFileOutputStream(ReliableFileDescriptor reliablefd)

用于使用 ReliableFileDescriptor 對象創(chuàng)建 AutoCloseFileOutputStream 實(shí)例的構(gòu)造函數(shù)。

參數(shù):

參數(shù)名稱 參數(shù)描述
reliablefd 指示要使用的 ReliableFileDescriptor 對象。

方法詳情

close

public void close() throws IOException

關(guān)閉此 AutoCloseFileOutputStream 對象,其 ReliableFileDescriptor 對象也會自動(dòng)關(guān)閉。

指定者:

在接口 AutoCloseable 中關(guān)閉

指定者:

在接口Closeable中關(guān)閉

覆蓋:

在類 FileOutputStream 中關(guān)閉

Throws:

Throw名稱 Throw描述
IOException 如果發(fā)生 I/O 錯(cuò)誤,則引發(fā)此異常。
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號