freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java語言程序設(shè)計(jì)(文件輸入輸出、java網(wǎng)絡(luò)編程)ppt-展示頁

2024-10-25 16:18本頁面
  

【正文】 輸入 /輸出 ? 文件讀寫操作 ? 目錄管理 ? 隨機(jī)訪問文件 ? 文件屬性 3 概念 ? I/O來源 ? 控制臺(tái) (console, 如 DOS窗口 )?打印 /讀入 ? 文件 (file)?讀 /寫 ? 網(wǎng)絡(luò)接口 (TCP/UDP端口 )?讀 /寫 ? 針對(duì)數(shù)據(jù)的讀寫 ? 以流 (stream)的方式對(duì)數(shù)據(jù)進(jìn)行操作 數(shù)據(jù)源 程序 讀出 數(shù) 據(jù) 流 目的 程序 寫入 數(shù) 據(jù) 流 流的重要特性 ?順序讀 /寫 ?sequentially 4 概念 ? 讀 /寫流的一般流程 ? 讀 (Reading) 1. open a stream //打開 讀出流 2. while more information //判斷 3. read information //讀 4. close the stream //關(guān)閉流 ? 寫 (Writing) 1. open a stream //打開 寫入流 2. while more information //判斷 3. write information //寫 4. close the stream //關(guān)閉流 5 概念 ? 兩種流的定義 (讀取信息的基本數(shù)據(jù)單位 ) ? 字節(jié)流 (byte stream): 一個(gè)字節(jié) (8bit)一個(gè)字節(jié)讀 /寫 ? 字符流 (character stream):一個(gè)字符一個(gè)字符讀 /寫 (具有特定字符編碼的數(shù)據(jù) ) j a v a 語 言 6A 61 76 61 D3 EF D1 D4 以字節(jié)流的方式讀 : 讀 8次, 8個(gè)字節(jié) 以字符流的方式讀 : 讀 6次, 6個(gè)字符 6 第九章 文件輸入輸出 1. 概念 2. Java I/O類 3. Java I/O操作 ? 標(biāo)準(zhǔn)輸入 /輸出 ? 文件讀寫操作 ? 目錄管理 ? 隨機(jī)訪問文件 ? 文件屬性 7 Java I/O類 ? 字節(jié)流 的讀 /寫操作 (來自 ) ? (抽象類 ) 1. public abstract int read() 2. public int read(byte b[]) 3. public int read(byte b[], int offset, int length) 4. 到達(dá)流的終點(diǎn),無數(shù)據(jù)讀出則返回 1 ? (抽象類 ) 1. public abstract void write(int b) 2. public void write(byte b[]) 3. public void write(byte b[], int offset, int length) ? 所有的讀 /寫函數(shù)都拋出 8 Java I/O類 ? 字符流 的讀 /寫操作 (來自 ) ? (抽象類 ) 1. public int read() 2. public int read(char cbuf[]) 3. publc abstract int read(char cbuf[], int offset, int length) 4. 到達(dá)流的終點(diǎn),無數(shù)據(jù)讀出則返回 1 ? (抽象類 ) 1. public void write(int c) 2. public void write(char cbuf[]) 3. public void write(char cbuf[], int offset, int length) ? 所有的讀 /寫函數(shù)都拋出 9 Java I/O類 ? I/O流的層次關(guān)系 ? class ? class ? class ? class ? class ? class ? class ? class ? class ? class ? class ? class ? … … … 10 Java I/O類 ? I/O流的層次關(guān)系 ? class ? class ? class ? class ? class ? class ? class ? class ? class ? … … … 11 Java I/O類 ? I/O流的層次關(guān)系 ? class ? class ? class ? class ? class ? class ? class ? class ? class ? class ? … … … 12 Java I/O類 ? I/O流的層次關(guān)系 ? class ? class ? class ? class ? class ? class ? class ? class ? class ? … … … 13 Java I/O類 ? I/O流的分類 (12個(gè)功能類 ) I/O類型 所用到的類 描述 文件 FileReader/FileWriter FileInputStream/FileOutputStream 文件流 (讀 /寫文件 ) 緩沖 BufferedReader/BufferedWriter BufferedInputStream BufferedOutputStream 提高讀 /寫效率 打印 PrintWriter PrintStream (()) 內(nèi)存 CharArrayReader/CharArrayWriter ByteArrayInputStream ByteArrayOutputStream StringReader/StringWriter StringBufferInputStream 讀 /寫內(nèi)存 14 Java I/O類 ? I/O流的分類 (12個(gè)功能類 ) I/O類型 所用到的類 描述 字節(jié)流和字符流的轉(zhuǎn)換 InputStreamReader OutputStreamWriter 將 InputStream中讀入的字節(jié)轉(zhuǎn)為字符 /將字符轉(zhuǎn)為字節(jié)寫入OutputStream 管道 pipe PipedReader/PipedWriter PipedInputStream/PipedOutputStream 文件流 (讀 /寫文件 ) 連接 Concatenation SequenceInputStream 多個(gè)輸入流連接為一個(gè)輸入流 對(duì)象串行化 ObjectInputStream ObjectOutputStream Object Serialization 15 Java I/O類 ? I/O流的分類 (12個(gè)功能類 ) I/O類型 所用到的類 描述 基本數(shù)據(jù)轉(zhuǎn)化 DataInputStream DataOutputStream JAVA基本數(shù)據(jù)類型的讀 /寫 計(jì)數(shù) LineNumberReader LineNumberInputStream 讀操作時(shí)記錄行數(shù) Peeking Ahead PushbackReader PushbackInputStream 可回退緩存 (pushback buffer) 過濾 FilterReader/FilterWriter FilterInputStream/FilterOutputStream 在讀 /寫操作時(shí)對(duì)數(shù)據(jù)進(jìn)行過濾 16 第九章 文件輸入輸出 1. 概念 2. Java I/O類 3. Java I/O操作 ? 標(biāo)準(zhǔn)輸入 /輸出 ? 文件讀寫操作 ? 目錄管理 ? 隨機(jī)訪問文件 ? 文件屬性 17 Java I/O操作 ? 主要內(nèi)容 1. 標(biāo)準(zhǔn)輸入 /輸出 ? 控制臺(tái)屏幕打印和鍵盤讀入 2. 文件 I/O操作 ? 文件讀寫 ? 如何提高文件讀寫效率 ? 流的包裝 (Wrap) ? 基本數(shù)據(jù)轉(zhuǎn)換流 ? 目錄管理 ? 隨機(jī)訪問文件 (Random Access File) ? 文件屬性 3. 網(wǎng)絡(luò)流操作 (見第十三講 ) 18 ? 輸出 : 控制臺(tái)屏幕打印 class Test { public static void main(String args[]) { (“Hello World!”)。 } } 標(biāo)準(zhǔn)輸入 /輸出 19 ? 輸入 : 鍵盤讀入 import 。 (Received number= + (b))。 public class CopyBytes { public static void main(String[] args) throws IOException { File inputFile = new File(“)。 FileInputStream in = new FileInputStream(inputFile)。 int c。 ()。 } } public int read ()throws IOException public int read (byte[] b) throws IOException public int read (byte[] b, int off, int len) throws IOException FileInputStream in = new FileInputStream(“)。 public void write (int b) throws IOException public void write (byte[] b) throws IOException public void write (byte[] b, int off, int l n) throws IOException 23 2. 字符流構(gòu)造方法 ? public FileReader(File file) throws FileNotFoundException ? public FileReader(String fileName) throws FileNotFoundException ? public File(String pathname) ? public FileWriter(File file) throws IOException ? public FileWriter(File file, boolean append) throws IOException ? public FileWriter(String fileName) throws IOException ? public FileWriter(String fileName, boolean append) throws IOException 文件讀寫操作 24 ? 文件讀寫 實(shí)例 2 文件讀寫操作 import .*。 File outputFile = new File(“)。 FileWriter out = new FileWriter(outputFile)。 while ((c = ()) != 1) (c)。 ()。 FileWriter out = new FileWriter(“)。 FileInputStream fis = new Fi
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1