日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSObjectInput

ObjectInput

沛縣網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián),沛縣網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為沛縣上千余家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站制作要多少錢,請找那個售后服務(wù)好的沛縣做網(wǎng)站的公司定做!

public interface ObjectInput
extends DataInput, AutoCloseable

ObjectInput 擴展了 DataInput 接口以包括對象的讀取。 DataInput 包括用于輸入原始類型的方法,ObjectInput 擴展了該接口以包括對象、數(shù)組和字符串。

Since:

JDK1.1

方法總結(jié)

修飾符和類型 方法 描述
intavailable()返回可以在不阻塞的情況下讀取的字節(jié)數(shù)。
voidclose()關(guān)閉輸入流。
intread()讀取一個字節(jié)的數(shù)據(jù)。
intread(byte[] b)讀入一個字節(jié)數(shù)組。
intread(byte[] b, int off, int len)讀入一個字節(jié)數(shù)組。
ObjectreadObject()讀取并返回一個對象。
longskip(long n)跳過 n 個字節(jié)的輸入。
從接口 java.io.DataInput 繼承的方法
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes

方法詳情

readObject

Object readObject() throws ClassNotFoundException, IOException

讀取并返回一個對象。 實現(xiàn)此接口的類定義了從何處“讀取”對象。

返回:

從流中讀取的對象

Throws:

Throw名稱 Throw描述
ClassNotFoundException如果找不到序列化對象的類。
IOException如果發(fā)生任何常見的輸入/輸出相關(guān)異常。

read

int read() throws IOException

讀取一個字節(jié)的數(shù)據(jù)。 如果沒有可用的輸入,此方法將阻塞。

返回:

讀取的字節(jié),如果到達流的末尾,則為 -1。

Throws:

Throw名稱 Throw描述
IOException如果發(fā)生 I/O 錯誤。

read

int read(byte[] b) throws IOException

讀入一個字節(jié)數(shù)組。 此方法將阻塞,直到某些輸入可用。

參數(shù):

參數(shù)名稱 參數(shù)描述
b讀取數(shù)據(jù)的緩沖區(qū)

返回:

實際讀取的字節(jié)數(shù),到達流末尾時返回-1。

Throws:

Throw名稱 Throw描述
IOException如果發(fā)生 I/O 錯誤。

read

int read(byte[] b, int off, int len) throws IOException

讀入一個字節(jié)數(shù)組。 此方法將阻塞,直到某些輸入可用。

參數(shù):

參數(shù)名稱 參數(shù)描述
b讀取數(shù)據(jù)的緩沖區(qū)
off數(shù)據(jù)的起始偏移量
len讀取的最大字節(jié)數(shù)

返回:

實際讀取的字節(jié)數(shù),到達流末尾時返回-1。

Throws:

Throw名稱 Throw描述
IOException如果發(fā)生 I/O 錯誤。

skip

long skip(long n) throws IOException

跳過 n 個字節(jié)的輸入。

參數(shù):

參數(shù)名稱 參數(shù)描述
n要跳過的字節(jié)數(shù)

返回:

跳過的實際字節(jié)數(shù)。

Throws:

Throw名稱 Throw描述
IOException如果發(fā)生 I/O 錯誤。

available

int available() throws IOException

返回可以在不阻塞的情況下讀取的字節(jié)數(shù)。

返回:

可用字節(jié)數(shù)。

Throws:

Throw名稱 Throw描述
IOException如果發(fā)生 I/O 錯誤。

close

void close() throws IOException

關(guān)閉輸入流。 必須調(diào)用以釋放與流關(guān)聯(lián)的任何資源。

指定者:

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

Throws:

Throw名稱 Throw描述
IOException如果發(fā)生 I/O 錯誤。

新聞標(biāo)題:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSObjectInput
瀏覽路徑:http://www.dlmjj.cn/article/cohpigs.html