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

正文內(nèi)容

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

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

下一頁面
 

【正文】 FileInputStream (f)。 }catch(UnsupportedEncodingException e) { (the encoding was not found: +e)。 myFileStream = new FileOutputStream ( “)。 myFileStream = new FileOutputStream(myFile)。 b=(buffer)。 } } 17 5. FileReader 和 FileWriter ?與 FileInputStream和 FileOutputStream等價的讀取器是 FileReader類和 FileWriter類。 如: FileReader file = new FileReader(“”)。 如: BufferedReader in= BufferedReader(new FileReader(“”))。 FileReader file。 try { File f=new File(E:\\lanhong\\, )。 (this)。 add(text,Center)。 } public void actionPerformed(ActionEvent e) { String s。 }} 21 5. 2 BufferedWriter ? 與 BufferedReader 類相對應的是 BufferedWriter 類。 (“how are you”, 0, ())。 Button button。 ()。 (this)。 add(text,Center)。}} )。 }catch(IOException exp) {} } }} public class Example20_5 { public static void main(String args[]) { FWindow w=new FWindow()。 //聲明兩個文件對話框 MenuBar menubar1。 BufferedReader in。 Frame_FileDialog() { super(帶文件對話框的窗口 )。 menu1=new Menu(文件 )。 (this)。 setMenuBar(menubar1)。 (false)。}} )。 26 public void actionPerformed(ActionEvent e) { if(()==item1) { (true)。 file_reader=new FileReader(file)。)。 try{ //建立到文件 file的 FileWriter流,該文件通過 File 類和對話框來確定。 ((),0,(()).length())。 }catch(IOException exp) {} } } 28 6. RandomAccessFile 類 ? 由于 File 類不能讀寫文件,可使用 Stream 類或RandomAccessFile 類來讀寫。 RandomAccessFile(File file, String mode)。 getFilePointer() 方法獲取當前文件的指針的位置。 i++) { (data[i])。 //文件的第 36個字節(jié)讀取最后面的一個整數(shù) (“,” +())。 線程1線程2連接線程3連接管道輸出 管道輸入 管道輸出 管道輸入32 PipedInputStream類 ? PipedInputStream(): 創(chuàng)建一個管道輸入流,它還沒有被連接,在使用之前必須連接到一個管道輸出流。 (out)。 使用 connect(PipedInputStream c) 方法連接。 PipedOutputStream(PipedInputStream a)。 } catch (IOException e) {} 35 P274, 例 11 Example20_11 import .*。 in=new PipedInputStream()。 ()。 byte b[]={1,2,3}。 }catch (IOException e) {} } public void run() { try { (b,0,3)。 thread2(PipedInputStream a, PipedOutputStream b) { try { in=a。 for (int i=0。 ( +c)。 常用方法: P276. P277, 例 12 39 9. 對象流 ? ObjectInputStream類和 ObjectOutputStream類分別是DateInputStream和 DateOutputStream類的子類 . ? 構(gòu)造方法: DateInputStream(InputStream in)。 FileOutputStream file_out= new FileOutputStream(“”)。 FileInputStream file_in=null。 Example20_14() { setLayout(new FlowLayout())。 (this)。 add(reader)。 pack()。 (text)。 TextArea temp=(TextArea)()。 (600,600)。} } } 43 10. PrintStream 類 ? 使用數(shù)據(jù)流寫成的文件用其他文件閱讀器無法進行閱讀(看上去是亂碼)。 (12345)。 (button)。 try { PrintWriter ps=new PrintWriter(new FileOutputStream())。 (
點擊復制文檔內(nèi)容
教學課件相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1