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

正文內(nèi)容

輸入輸出流(帶倉庫系統(tǒng)作業(yè))-wenkub

2023-03-18 06:54:11 本頁面
 

【正文】 in=new BufferedReader(file)。 text=new TextArea(10,10)。 BufferedReader in。 ?構(gòu)造方法是: BufferedReader(Reader in)。 ?構(gòu)造方法分別是: FileReader(String filename)。 (buffer,0,b)。 byte buffer[]=new byte[100]。 FileOutputSteam myFileStream。 } 13 4. FileOutputStream ? FileOutputStream用 于 向 一 個 文 本 文 件 寫 數(shù) 據(jù)。 try { String str=new String(buffer,0,b,Default)。 byte buffer[]=new byte[2500]。 //len 指定該方法將讀取的最大字節(jié)數(shù)。 myFileStream = new FileInputStream(myFile)。 myFileStream = new FileInputStream (“)。 通過 使 用 FileInputStream你 可 以 訪 問 文 件 的 一 個 字 節(jié)、 幾 個 字 節(jié)或 整 個 文 件。 String isHid = () ? Yes : No。 String exists = () ? Yes : No。 ? Java 的 I/O 流庫提供大量的流類 (在包) , 其中,所有輸入流類都是InputStream( 抽象類)或抽象類 Reader的子類,而所有輸出流類都是OutputStream( 抽象類)或抽象類Writer的子類 3 (File 類 ) ? File 類不允許訪問文件的內(nèi)容 ,沒有可用于訪問文件的 read() 和 write()方法 . ? File 類主要用于命名文件 ,查詢文件屬性和處理目錄 . 4 . 創(chuàng)建文件對象 構(gòu)造方法 : 1. public File(String s)。 ( 在 Windows平臺,分割符為“ \” , 在Linux/Unix上,為“ /” , File 提供的參數(shù) : ) 2. public File(String Directory, String s)。 String canRead = () ? Yes : No。 String isDir = () ? Yes : No。 ? 由 InputStream 派生的類 ?構(gòu)造方法: FileInputStream(String name)。 或 : File myFile 。 9 處理 I/O 異常 ?必須使用 catch 塊檢測并處理 I/O 異常(IOException ), 如: try { FileInputStream ins= new FileInputStream (“)。 //到達輸入流末尾時, 返回 1 11 關(guān)閉 FileInputStream ?兩 種 方 法 關(guān) 閉 : 顯式 關(guān) 閉 和 隱 式 關(guān) 閉, 隱 式 關(guān) 閉 是 自 動 垃 圾 回 收 時 的 功 能。 try { File f=new File(E:\\lanhong\\, )。 (str)。 ?由 OutputStream 派生的類 14 打開 FileOutputStream ? 和 打 開 輸 入 流 FileInputStream類似 : FileOutput Stream myFileStream。 myFile = new File()。 try { (輸入一行文本,并存入磁盤 : )。 //通過流把 buffer 寫入到文件 中 }catch (IOException e) { (Error )。 FileWriter(String filename)。 ?讀取文本行的方法是: readLine()。 Button button。 ()。 } catch(FileNotFoundException e) {} catch(IOException e) {} button=new Button(讀取 )。 setVisible(true)。}} )。 ()。 如: BufferedWriter out= BufferedWriter(new FileReader(“”))。 BufferedWriter out。 text=new TextArea(10,10)。 }catch(FileNotFoundException e) {} catch(IOException e) {} button=new Button(寫入 )。 setVisible(true)。(0)。 ()。 24 P267, 例 7 Example20_7 class Frame_FileDialog extends Frame implements ActionListener { FileDialog filedialog_save,filedialog_load。 TextArea text。 FileWriter tofile。 menubar1=new MenuBar()。 (this)。(menu1)。 //再創(chuàng)建一個依賴于該窗口的打開文件對話框 filedialog_load=new FileDialog(this,打開文件對話框 , )。 ( new WindowAdapter() {public void windowClosing(WindowEvent e){ (false)。}} )。 File file=new File((),())。\n39。
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1