Java IO

Summary

Direction: Input stream & Output stream.

Type of data: Byte Stream Classes & Character Stream Classes.

Byte Stream Classes

?read bytes from an input stream and write bytes to an output stream.

InputStream


InputStream class is a base class of all the classes that are used to read bytes from a file, memory or console. InputStream is an abstract class and hence we can't create its object but we can use its subclasses for reading bytes from the input stream.

OutputStream


OutputStream class is a base class of all the classes that are used to write bytes to a file, memory or console. OutputStream is an abstract class and hence we can't create its object but we can use its subclasses for writing bytes to the output stream. In the diagram below we have shown the hierarchy of output stream class and some of its important subclasses that are used to write bytes.

Character Stream Classes

used to read characters from the source and write?characters?to the destination.

two kinds of Character Stream classes - Reader classes and Writer classes.?

Reader


Reader class and its subclasses are used to read characters from the source.?

Reader class is a base class of all the classes that are used to read characters from a file, memory or console. Reader is an abstract class and hence we can't instantiate it but we can use its subclasses for reading characters from the input stream. We will discuss subclasses of Reader class with their code, in the next few articles.?

Writer


Writer class and its subclasses are used to write characters to a file, memory or console. Writer is an abstract class and hence we can't create its object but we can use its subclasses for writing characters to the output stream. We will discuss subclasses of Writer with their code in the next few articles.?

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,855評論 0 10
  • 和媽媽一起坐地鐵 我喜歡有窗的地方 我跪在這里 看了半小時(shí)風(fēng)景 我一句話都沒說 對面的地鐵也一句話都沒說 直接和我...
    每日愛圖閱讀 122評論 0 1
  • 【日精進(jìn)第92天】 劉金璐17178121717 一、【學(xué)~勤學(xué)】 ①日常課誦 《六項(xiàng)精進(jìn)》 ②專業(yè)成長 《十項(xiàng)職...
    LESSMORE造型Eva金璐閱讀 199評論 0 0
  • 有我是日記星球270號星寶寶素梅—素食者王繼梅,正在參加日記星球第七期21天蛻變之旅,這是我的第51篇原創(chuàng)日記,堅(jiān)...
    素梅1素食者王繼梅閱讀 226評論 0 0

友情鏈接更多精彩內(nèi)容