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

正文內(nèi)容

輸入輸出流(帶倉庫系統(tǒng)作業(yè))(留存版)

2025-03-29 06:54上一頁面

下一頁面
  

【正文】 File 類主要用于命名文件 ,查詢文件屬性和處理目錄 . 4 . 創(chuàng)建文件對象 構(gòu)造方法 : 1. public File(String s)。 myFileStream = new FileInputStream (“)。 try { String str=new String(buffer,0,b,Default)。 (buffer,0,b)。 text=new TextArea(10,10)。 }catch(IOException exp) {} } } public class Example20_4 { public static void main(String args[]) { EWindow w=new EWindow()。 out=new BufferedWriter(tofile)。 }} 。 item2=new MenuItem(保存文件 )。(0)。 tofile=new FileWriter(file)。 try { for(int i=0。 //創(chuàng)建一個管道輸入流,它被連接到由參數(shù) a指定的管道輸出流。 }catch (IOException e) {} thread1 one = new thread1(out,in)。 (out)。 41 P281, 例 14 public class Example20_14 extends Frame implements ActionListener { TextArea text=null。 addWindowListener( new WindowAdapter() {public void windowClosing(WindowEvent e) { (0)。 }catch(ClassNotFoundException e) { (“不能讀出對象 )。(how are you)。 }catch (IOException e) {} 44 11. PrintWriter 類 ?與 PrintStream 類類似。 (temp)。 setVisible(true)。 ? ObjectInputStream類和 ObjectOutputStream 類創(chuàng)建的對象被稱為對象輸入流和對象輸出流 . ? 對象輸出流使用 writeObject(Object obj) 方法寫文件 . ? 對象輸入流使用 readObject() 方法讀文件 . 40 創(chuàng)建對象流的方法 ? ObjectInputStream/ DateOutputStream的指向是一個輸入 /輸出流對象,因而要首先用 FileInputStream/ FileOutputStream 創(chuàng)建一個文件流 . 如: FileInputStream file_in= new FileInputStream(“”)。 PipedInputStream in。 PipedInputStream in=null。 PipedInputStream() in = new PipedInputStream()。 ?RandomAccessFile類中的方法: seek(long a)。 ()。}} )。 setVisible(true)。 if(()==button) { try{ ((),0,(()).length())。 FWindow() { super(流的寫入 )。 addWindowListener( new WindowAdapter() {public void windowClosing(WindowEvent e){(0)。 BufferedReader in。 byte buffer[]=new byte[100]。 byte buffer[]=new byte[2500]。 通過 使 用 FileInputStream你 可 以 訪 問 文 件 的 一 個 字 節(jié)、 幾 個 字 節(jié)或 整 個 文 件。 ( 在 Windows平臺,分割符為“ \” , 在Linux/Unix上,為“ /” , File 提供的參數(shù) : ) 2. public File(String Directory, String s)。 或 : File myFile 。 (str)。 //通過流把 buffer 寫入到文件 中 }catch (IOException e) { (Error )。 ()。 ()。 }catch(FileNotFoundException e) {} catch(IOException e) {} button=new Button(寫入 )。 24 P267, 例 7 Example20_7 class Frame_FileDialog extends Frame implements ActionListener { FileDialog filedialog_save,filedialog_load。 (this)。}} )。 out=new BufferedWriter(tofile)。 i。 33 PipedOutputStream類 ? PipedOutputStream(): 創(chuàng)建一個管道輸出流,它還沒有被連接,在使用之前必須連接到一個管道輸入流。 thread2 two = new thread2(in,out)。 }catch (IOException e) {} } public void run() { try { (a,0,3)。 Button reader=null, writer=null。}} )。 }catch(IOException Event) { (can not read file)。 (234)。 ()。 ()。 (this)。 DateOutputStream(OutputStream out)。 }catch
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1