新聞中心
ObjectOutput

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


咨詢
建站咨詢
