InputStream:定義 read() 讀取單字節/位元組陣列,所有輸入流父類。OutputStream:定義 write() 寫入單字節/位元組陣列,所有輸出流父類。read()/write() 供高層流複用,極少直接使用。// 輸入鏈
new DataInputStream(
new BufferedInputStream(
new FileInputStream("data.bin")));
// 輸出鏈
new PrintStream(
new BufferedOutputStream(
new FileOutputStream("log.txt")));