新聞中心
ObjectOutput

創(chuàng)新互聯(lián)專注于清原網(wǎng)站建設(shè)服務及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗。 熱誠為您提供清原營銷型網(wǎng)站建設(shè),清原網(wǎng)站制作、清原網(wǎng)頁設(shè)計、清原網(wǎng)站官網(wǎng)定制、重慶小程序開發(fā)服務,打造清原網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供清原網(wǎng)站排名全網(wǎng)營銷落地服務。
public interface ObjectOutput
extends DataOutput, AutoCloseableObjectOutput 擴展了 DataOutput 接口以包括對象的寫入。 DataOutput 包括用于輸出原始類型的方法,ObjectOutput 擴展了該接口以包括對象、數(shù)組和字符串。
Since:
JDK1.1
方法總結(jié)
| 修飾符和類型 | 方法 | 描述 |
|---|---|---|
| void | close() | 關(guān)閉流。 |
| void | flush() | 沖洗流。 |
| void | write(byte[] b) | 寫入一個字節(jié)數(shù)組。 |
| void | write(byte[] b, int off, int len) | 寫入一個子字節(jié)數(shù)組。 |
| void | write(int b) | 寫入一個字節(jié)。 |
| void | writeObject(Object obj) | 將對象寫入底層存儲或流。 |
| 從接口 java.io.DataOutput 繼承的方法 |
|---|
| writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
方法詳情
writeObject
void writeObject(Object obj) throws IOException
將對象寫入底層存儲或流。 實現(xiàn)此接口的類定義了對象的編寫方式。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| obj | 要寫入的對象 |
Throws:
| Throw名稱 | Throw描述 |
|---|---|
| IOException | 任何常見的輸入/輸出相關(guān)異常。 |
write
void write(int b) throws IOException
寫入一個字節(jié)。 此方法將阻塞,直到實際寫入字節(jié)。
指定者:
寫入接口DataOutput
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| b | 字節(jié) |
Throws:
| Throw名稱 | Throw描述 |
|---|---|
| IOException | 如果發(fā)生 I/O 錯誤。 |
write
void write(byte[] b) throws IOException
寫入一個字節(jié)數(shù)組。 此方法將阻塞,直到實際寫入字節(jié)。
指定者:
寫入接口DataOutput
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| b | 要寫入的數(shù)據(jù) |
Throws:
| Throw名稱 | Throw描述 |
|---|---|
| IOException | 如果發(fā)生 I/O 錯誤。 |
write
void write(byte[] b, int off, int len) throws IOException
寫入一個子字節(jié)數(shù)組。
指定者:
寫入接口DataOutput
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| b | 要寫入的數(shù)據(jù) |
| off | 數(shù)據(jù)中的起始偏移量 |
| len | 寫入的字節(jié)數(shù) |
Throws:
| Throw名稱 | Throw描述 |
|---|---|
| IOException | 如果發(fā)生 I/O 錯誤。 |
flush
void flush() throws IOException
沖洗流。 這將寫入任何緩沖的輸出字節(jié)。
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 錯誤。 |
網(wǎng)頁標題:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSObjectOutput
網(wǎng)站URL:http://www.5511xx.com/article/cdgihgc.html


咨詢
建站咨詢
