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

正文內(nèi)容

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

2024-12-03 16:18本頁面
  

【正文】 leInputStream(filename)。 int c。A39。 } } ()。 ? 如何提高文件讀寫效率 實(shí)例 1 如何提高文件讀寫效率 String filename = “”。 BufferedInputStream bis = new BufferedInputStream(fis)。 int c。A39。 } } ()。 FileInputStr amfis = new FileInputStream(“”)。 final int BUFSIZE = 1024。 int len。 i len。A39。 } } } ()。 FileReader fr = new FileReader(filename)。 int count = 0。 } ()。 ? 如何提高文件讀寫效率 實(shí)例 2 如何提高文件讀寫效率 29 ? 概述 流的包裝 (wrap) FileReader fr = new FileReader (filename)。 BufferedReader br = new BufferedReader ( new FileReader(filename))。 public String readLine() in public void println(String x) in ? 利用不同流的特點(diǎn) (方法 ) ? 尋找合適的方法完成特定的需求 ? 對(duì)已有的流進(jìn)行再處理 30 ? 流的種類 ? 節(jié)點(diǎn)流 ? 直接對(duì)數(shù)據(jù)源進(jìn)行讀 /寫操作的流 ? 處理流 ? 對(duì)一個(gè)已有的流進(jìn)行某種操作的流 流的包裝 (wrap) 31 ? 節(jié)點(diǎn)流 ? FileInputStream, PipedInputStream, ByteArrayInputStream, StringBufferInputStream ? FileOutputStream, PipedOutputStream, ByteArrayOutputStream ? CharArrayReader, FileReader, PipedReader, StringReader ? CharArrayWriter, FileWriter, PipedWriter, StringWriter 流的包裝 (wrap) 32 ? 處理流 ? FilterOutputStream, DataOutputStream, BufferedOutputStream, PrintStream ? FilterInputStream, LineNumberInputStream, DataInputStream, BufferedInputStream, PushbackInputStream ? BufferedReader, LineNumberReader, InputStreamReader, FilterReader, PushBackReader ? BufferedWriter, OutputStreamReader, FilterWriter, PrintWriter 流的包裝 (wrap) 33 ? 一個(gè)實(shí)例 ? ? public FileReader(File file) throws FileNotFoundException ? public FileReader(String fileName) throws FileNotFoundException ? ? public BufferedReader(Reader in) 8192 bytes ? public BufferedReader(Reader in, int sz) ? 流的包裝 ?改變了流的行為 流的包裝 (wrap) 34 ? 流的包裝 (wrap)實(shí)例 1 流的包裝 (wrap) import .*。 String s。 } } public static final InputStream in () public InputStreamReader(InputStream in) public BufferedReader(Reader in) 程序如何結(jié)束 跳出 while循環(huán) )? 35 ? 概述 ? ? public DataInputStream(InputStream in) ? public final boolean readBoolean() ? public final byte readByte() ? public final char readChar() ? public final int readInt() ? ? public DataOutputStream(OutputStream out) ? public final void writeBoolean(boolean v) ? public final void writeByte(int v) ? public final void writeChar(int v) ? public final void writeInt(int v) 基本數(shù)據(jù)轉(zhuǎn)換流 36 DataOutputStream out = new DataOutputStream(new FileOutputStream())。 int units[]= {12, 8}。 for (int i = 0。 i ++) { (prices[i])。\t39。 (units[i])。\t39。 (descs[i])。\n39。 } ()。 double total。 ()。 ()。 StringBuffer desc = new StringBuffer(20)。 (You39。 total = total + unit * price。 ()。 public class DirList { public static void main(String[] args) { File path = new File(.)。 for(int i = 0。 i++) (list[i])。 import 。 String[] list = (new DirFilter(args[0]))。 i 。 } } class DirFilter implements FilenameFilter { String key。 } public boolean accept(File dir, String name) { String f = new File(name).getName()。 } } 接口 public boolean accept(File dir, String name)。 for(int i = 0。 i++) (i*)。 rf = new RandomAccessFile(, rw)。 ()。 rf = new RandomAccessFile(, r)。 i 10。 ()。 class AttrDemo1 { public static void main(String[] args) throws IOException { File testfile = new File(. + + testfile1)。 (name = + ())。 (absolute path = + ())。 } } 46 文件屬性 ? 獲取文件修改時(shí)間 import .*。 public class AttrDemo2 { public static void main(String[] args) throws IOException { File testfile = new File(testfile2)。 ()。 (last modification time 1 = + new Date(modtime))。 modtime = ()。 } } 47 文件屬性 ? 獲取和設(shè)定文件長(zhǎng)度 import .*。 ()。 (length 1 = +())。 (100)。 (length 2 = + ())。 public class AttrDemo4 { public static void main(String[] args) throws IOException { File testfile = new File(testfile4)。 ()。 if (()) (file can be written 1)。 if (()) (file can be read 2)。 } } 49 第九章 結(jié)束 ! 50 1. 概述 2. URL應(yīng)用 3. Socket應(yīng)用 4. UDP數(shù)據(jù)報(bào) 第十章 Java網(wǎng)絡(luò)編程 51 概述 ? The Java platform is highly regarded in part because of its suitability for writing programs that use and interact with the resources on the Inter and the World Wide Web. 52 概述 1. Applet ? Applet程序嵌在 HTML文件中,通過網(wǎng)絡(luò)下載 Applet程序代碼,在本地 Javaenabled browser 中執(zhí)行 2. HTTP ? 通過 URL類獲取服務(wù)器端的 HTML文件 3. Socket(套接字 ) ? 實(shí)現(xiàn) Client/Server結(jié)構(gòu)的應(yīng)用 4. JDBC (Java Database Connectivity) ? 通過網(wǎng)絡(luò)訪問關(guān)系型數(shù)據(jù)庫(kù) ? Oracle, MS SQL, Sybase 5. Servlet/JSP (Java Server Page) ? WEB服務(wù)器端的動(dòng)態(tài)編程 53 概述 ? 網(wǎng)絡(luò)基礎(chǔ) TCP/IP協(xié)議簇 ? 網(wǎng)絡(luò)層 (Network Layer) ? Inter Protocol (IP), ? IP地址 , 32比特 ? 傳輸層 (Transport Layer) ? 傳輸控制協(xié)議 (TCP: Transport Control Protocol) ? 用戶數(shù)據(jù)報(bào)協(xié)議 (UDP: User Datagram Protocol) ? 端口 (Port, 16比特 , 0~65535) ? 應(yīng)用層 (Application Layer) ? HTTP, FTP, SMTP, POP3, Tel, DNS TCP or UDP Port 應(yīng)用 Port Port Port Port 數(shù)據(jù) 1 應(yīng)用 應(yīng)用 應(yīng)用 Port 數(shù)據(jù) 2 主機(jī) 54 概述 ? Java語言中基本網(wǎng)絡(luò)類 ? Package ? ? ? ? ? ? ?
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1