W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
java.lang.Object
|---java.io.InputStream
|---|---java.io.FileInputStream
|---|---|---ohos.rpc.ReliableFileDescriptor.AutoCloseFileInputStream
public static class ReliableFileDescriptor.AutoCloseFileInputStream
extends FileInputStream
表示一個文件輸入流,其文件描述符在此流關(guān)閉時自動關(guān)閉。
此類僅適用于同一設(shè)備上的操作。
構(gòu)造函數(shù) | 描述 |
---|---|
AutoCloseFileInputStream(ReliableFileDescriptor reliablefd) | 用于使用 ReliableFileDescriptor 對象創(chuàng)建 AutoCloseFileInputStream 實例的構(gòu)造函數(shù)。 |
修飾符和類型 | 方法 | 描述 |
---|---|---|
void | close() | 關(guān)閉此 AutoCloseFileInputStream 對象,其 ReliableFileDescriptor 對象也將自動關(guān)閉。 |
int | read() | 從此 AutoCloseFileInputStream 對象中讀取一個整數(shù)。 |
從類 java.io.FileInputStream 繼承的方法 |
---|
available, finalize, getChannel, getFD, read, read, skip |
從類 java.io.InputStream 繼承的方法 |
---|
mark, markSupported, reset |
從類 java.lang.Object 繼承的方法 |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
public AutoCloseFileInputStream(ReliableFileDescriptor reliablefd)
用于使用 ReliableFileDescriptor 對象創(chuàng)建 AutoCloseFileInputStream 實例的構(gòu)造函數(shù)。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
reliablefd | 指示要使用的 ReliableFileDescriptor 對象。 |
public void close() throws IOException
關(guān)閉此 AutoCloseFileInputStream 對象,其 ReliableFileDescriptor 對象也將自動關(guān)閉。
指定者:
在接口 AutoCloseable 中關(guān)閉
指定者:
在接口Closeable中關(guān)閉
覆蓋:
在類 FileInputStream 中關(guān)閉
Throws:
Throw名稱 | Throw描述 |
---|---|
IOException | 如果發(fā)生 I/O 錯誤,則引發(fā)此異常。 |
public int read() throws IOException
從此 AutoCloseFileInputStream 對象中讀取一個整數(shù)。
覆蓋:
讀入類 FileInputStream
返回:
返回整數(shù)。
Throws:
Throw名稱 | Throw描述 |
---|---|
IOException | 如果發(fā)生 I/O 錯誤,則引發(fā)此異常。 |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: