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

正文內(nèi)容

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

2024-10-22 16:18本頁面
  

【正文】 write(byte[] b, int off, int len) ? public final void writeBoolean()/writeByte()/writeChar()/writeShort()/writeInt()/writeDouble()/writeFloat() 隨機(jī)訪問文件 43 ? 隨機(jī)訪問文件 (Random Access File)實(shí)例 隨機(jī)訪問文件 RandomAccessFile rf = new RandomAccessFile(, rw)。 return (key) != 1。 DirFilter(String key) { = key。 i++) (list[i])。 for (int i = 0。 public class DirList { public static void main(String[] args) { File path = new File(.)。 } } 40 ? 目錄管理 —方法舉例 目錄管理 import 。 i 。 String[] list = ()。 12 Java Tshirt 8 Java Mug 37 ? 概述 ? : 文件和目錄的路徑名 ? 構(gòu)造方法 ? public File(String pathname) ? public File(String parent, String child) ? public File(File parent, String child) ? parent通常表示一個(gè)目錄, child則表示一個(gè)目錄或文件 ? 路徑名 (pathname) ? UNIX平臺(tái)上絕對(duì)路徑的前綴“ /”,相對(duì)路徑無前綴,例“ /etc/”、“ ” ? Windows平臺(tái),絕對(duì)路徑名的前綴由“盤符 :\”組成; UNC 路徑名前綴為“ \\”,然后是主機(jī)名和共享名,相對(duì)路徑名無盤符,例“ c:\windows\”、“ ” 目錄管理 38 ? 方法 ? public boolean canWrite()/canRead() ? public boolean exists() ? public boolean delete() 刪除文件或目錄,若刪除目錄,要求該目錄必須為空 ? public boolean createNewFile() 創(chuàng)建一個(gè)空文件,當(dāng)且僅當(dāng)該文件不存在 ? public boolean isDirectory()/isFile()/isHidden() ? public long lastModified()/public boolean setLastModified(long time) ? public String[] list() 得到當(dāng)前目錄下的所有文件名和目錄名,若該 File對(duì)象不是表示目錄,則返回 null ? public boolean mkdir()/mkdirs() 創(chuàng)建一個(gè)目錄 ? public boolean renameTo(File dest) ? public boolean setReadOnly() 目錄管理 39 ? 目錄管理 —方法舉例 目錄管理 import 。 } } catch (EOFException e) { } (For a TOTAL of: $ + total)。ve ordered + unit + units of + desc + at $ + price)。 while((chr = ())!= ?\n?) (chr)。 char chr。 int unit = ()。 try { while (true) { double price = ()。 ? 基本數(shù)據(jù)轉(zhuǎn)換流 實(shí)例 基本數(shù)據(jù)轉(zhuǎn)換流 DataInputStream in = new DataInputStream( new FileInputStream())。)。 (39。)。 (39。)。 (39。 i 。 String descs[] = {Java Tshirt, Java Mug}。 double prices[] = {, }。 while((s = ()).length() != 0) (s)。 public class Echo { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader( new InputStreamReader())。 PrintWriter out = new PrintWriter ( new BufferedWriter(new FileWriter(filename)))。 BufferedReader br = new BufferedReader (fr)。 (count)。 while (() != null) { count++。 BufferedReader br = new BufferedReader(fr)。 28 String filename = “”。) { count++。 i++) { if (buf[i] == 39。 while ((len = (buf) != 1) { f r (int i = 0。 byte buf[] = new byte[BUFSIZE]。 int count = 0。 (count)。) { count++。 while ((c = ()) != 1) { if (c == 39。 int count = 0。 FileInputStream fis = new FileInputStream(filename)。 (count)。) { count++。 while ((c = ()) != 1) { if (c == 39。 int count = 0。 public int read () throws IOException public int read (char[] cbuf) throws IOException public int read (char[] cbuf, int off, int len) throws IOException public void write (int b) throws IOException public void write (char[] cbuf) throws IOException public void write (char[] cbuf, int off, int l n) throws IOException 25 ? 兩類緩沖流 ? 針對(duì)字節(jié)流 ? ? ? 針對(duì)字符流 ? ? 如何提高文件讀寫效率 26 ? 構(gòu)造方法 ? public BufferedInputStream(InputStream in) 2048 bytes ? public BufferedInputStream(InputStream in, int size) ? public BufferedOutputStream(OutputStream out) 512 bytes ? public BufferedOutputStream(OutputStream out, int size) ? public BufferedReader(Reader in) 8192 bytes ? public BufferedReader(Reader in, int sz) ? public BufferedWriter(Writer out) 8192 byte ? public BufferedWriter(Writer out, int sz) 如何提高文件讀寫效率 27 String filename = “”。 } } FileReader in = new FileReader(“)。 ()。 int c。 FileReader in = new FileReader(inputFile)。 public class Copy { public static void main(String[] args) throws IOException { File inputFile = new File(“)。 FileOutputStream out = new FileOutputStream(“)。 ()。 while ((c = ()) != 1) (c)。 FileOutputStream out = new FileOutputStream(outputFile)。 File outputFile = new File(“)。 } } 標(biāo)準(zhǔn)輸入 /輸出 C:\java Test A Received number=3 C:\ 20 ? 文件讀 /寫流程 1. 打開文件流 2. 條件判斷 3. 讀出 /寫入 4. 關(guān)閉文件流 ? 兩種類型文件 ? FileInputStream/FileOutputStream (字節(jié)流 ) ? FileReader/FileWriter (字符流 ) 文件讀寫操作 21 1. 字節(jié)流構(gòu)造方法 ? public FileInputStream(File file) throws FileNotFoundException ? public FileInputStream(String name) throws FileNotFoundException ? public File(String pathname) ? public FileOutputStream(File file) throws FileNotFoundException ? public FileOutputStream(File file, boolean append) throws FileNotFoundException //是否向已存在的文件后添加 ? public FileOutputStream(String name) throws FileNotFoundException ? public FileOutputStream(String name, boolean append) throws FileNotFoundException 文件讀寫操作 22 ? 文件讀寫 實(shí)例 1 文件讀寫操作 import .*。 class Test { public static void main(String args[]) throws IOException { byte[] b = new byte[10]。1 Java語言程序設(shè)計(jì) 馬 皓 2 第九章 文件輸入輸出 1. 概念 2. Java I/O類 3. Java I/O操作 ? 標(biāo)準(zhǔn)
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1