中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

專業(yè)網(wǎng)站建設(shè)空間seo是什么車

專業(yè)網(wǎng)站建設(shè)空間,seo是什么車,裝修類網(wǎng)站模板下載,如何進網(wǎng)站目錄 一、數(shù)據(jù)流概念 1.輸入輸出的概念? 2.流的概念 3.流的操作 二、常用的流分類 三、文件輸入輸出流 1.FileReader和FileWriter 2.FileInputStream和FileOutStream 四、復制文件 一、數(shù)據(jù)流概念 1.輸入輸出的概念? 輸入輸出技術(shù)用于處理設(shè)備之間的數(shù)據(jù)傳輸&#x…

目錄

一、數(shù)據(jù)流概念

1.輸入輸出的概念?

2.流的概念

3.流的操作

二、常用的流分類

三、文件輸入輸出流

1.FileReader和FileWriter

2.FileInputStream和FileOutStream

四、復制文件


一、數(shù)據(jù)流概念

1.輸入輸出的概念?

? ? ? ? 輸入輸出技術(shù)用于處理設(shè)備之間的數(shù)據(jù)傳輸,指的是程序和外部設(shè)備或者其他計算機進行數(shù)據(jù)交換的過程,比如讀/寫文件、網(wǎng)絡(luò)通信等。將外部數(shù)據(jù)讀取到內(nèi)存中稱為輸入,將內(nèi)存數(shù)據(jù)輸出到磁盤、光盤中稱為輸出。

2.流的概念

? ? ? ? Java程序中,對于數(shù)據(jù)的輸出輸入操作以“流”的方式進行。java.io包下提供了各種“流”類接口,用于獲取不同種類的數(shù)據(jù),并通過標準的方法輸入或輸出數(shù)據(jù)。

3.流的操作

import java.io.FileInputStream;
import java.io.IOException;public class FileInputStreamTest {public static void main(String[] args) {// 確定源String path = "hello.txt";FileInputStream fis = null;try {// 打開流fis = new FileInputStream(path);// 操作流int res = 0;while ((res = fis.read()) != -1) {System.out.println((char) res);// 轉(zhuǎn)換類型為char}} catch (IOException e) {e.printStackTrace();} finally {try {// 關(guān)閉流fis.close();} catch (IOException e) {e.printStackTrace();}}}
}

二、常用的流分類

分類字節(jié)輸入流字節(jié)輸出流字符輸入流字符輸出流
抽象父類InputStreamOutputStreamReaderWriter
訪問文件FileInputStreamFileOutStreamFileReader?? ?FileWriter
訪問數(shù)值ByteArrayInputStreamByteArrayOutStreamCharArrayReaderCharArrayWriter
訪問管道PipedInputStream?? ?PipedOutStream?? ?PipedReader?? ?PipedWriter
訪問字符串StringReader?? ?StringWriter
緩沖流BufferedInputStream?? ?BufferedOutputStream?? ?BufferedReader?? ?BufferedWriter
轉(zhuǎn)換流InputStreamReader?? ?OutputStreamWriter
對象流ObjectInputStream?? ?ObjectOutputStream?? ? ?? ??
裝飾流FilterInputStream?? ?FilterOutputStream?? ?FilterReader?? ?FilterWriter
打印流PrintStream?? ? ?? ?PrintWriter
數(shù)據(jù)過濾流DataInputStream?? ?DataOutputStream

? ? ? ? InputStream和Reader是所有輸入流的基類,OutputStream和Writer是所有輸出六的基類。InputStream和OutputStream是字節(jié)流的抽象父類,以字節(jié)為單位進行I/O操作,Reader和Writer是字符流的抽象父類,以字符為單位進行I/O操作。

三、文件輸入輸出流

1.FileReader和FileWriter

? ? ? ? FileReader和FileWriter分別繼承自Reader和Writer,以字符為的那位廣泛用于文件操作的節(jié)點流。FileReader類用于從文本讀數(shù)據(jù),每次度一個字符或者一個字符數(shù)組;FileWriter類用于從文本文件寫數(shù)據(jù),每次寫入一個字符、一個數(shù)組或者一個字符串。

2.FileInputStream和FileOutStream

? ? ? ? FileInputStream和FileOutStream分別繼承自InputStream和FileOutStream,以字節(jié)為單位廣泛用于文件操作的節(jié)點流。FileInputStream類用于從文件讀取數(shù)據(jù),FileOutStream類用于將數(shù)據(jù)寫入文件

四、復制文件

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;public class Copy {public static void main(String[] args) {FileInputStream fis = null;FileOutputStream fos = null;try {// 打開流fis = new FileInputStream("hello.txt");//路徑fos = new FileOutputStream("hello1.txt");byte[] bytes = new byte[10];// 操作流while (fis.read(bytes) != -1) {fos.write(bytes);fos.flush();}System.out.println("復制完成!");} catch (Exception e) {e.printStackTrace();} finally {try {if (null != fos)// 關(guān)閉流fos.close();} catch (IOException e) {e.printStackTrace();}try {if (null != fis)fis.close();} catch (IOException e) {e.printStackTrace();}}}
}

http://www.risenshineclean.com/news/44875.html

相關(guān)文章:

  • 上海給政府機關(guān)做網(wǎng)站開發(fā) 萬農(nóng)產(chǎn)品網(wǎng)絡(luò)營銷方案
  • 福建參觀禁毒展覽館的網(wǎng)站建設(shè)網(wǎng)站設(shè)計公司報價
  • 包頭全網(wǎng)營銷網(wǎng)站建設(shè)seo外包收費
  • 網(wǎng)站建設(shè)智能優(yōu)化seo優(yōu)化技術(shù)排名
  • 直播系統(tǒng)百度seo2022新算法更新
  • 單位做網(wǎng)站需要準備什么深圳優(yōu)化怎么做搜索
  • 三門峽網(wǎng)站建設(shè)電話熱狗網(wǎng)站排名優(yōu)化外包
  • 北京企業(yè)網(wǎng)站建設(shè)哪家服務(wù)好營銷頁面
  • 知名網(wǎng)站建設(shè)官網(wǎng)網(wǎng)站性能優(yōu)化方法
  • 360免費做網(wǎng)站凡科建站怎么導出網(wǎng)頁
  • 重慶網(wǎng)站排名公司友情鏈接免費發(fā)布平臺
  • 建設(shè)獨立網(wǎng)站的公司嗎長沙seo培訓
  • 南寧企業(yè)網(wǎng)站建站模板中文網(wǎng)站排名
  • 租車網(wǎng)站建設(shè)2345網(wǎng)址大全下載到桌面
  • jq 網(wǎng)站頭部廣告代碼大學生創(chuàng)新創(chuàng)業(yè)大賽
  • 網(wǎng)站集群怎么做網(wǎng)絡(luò)運營推廣合作
  • 做效果圖兼職的網(wǎng)站珠海網(wǎng)絡(luò)推廣公司
  • php網(wǎng)站開發(fā)演講稿鏈接搜索引擎
  • 深圳哪家網(wǎng)站建設(shè)的公司好蘋果cms永久免費全能建站程序
  • 什么網(wǎng)站做蜘蛛池廈門網(wǎng)絡(luò)推廣培訓
  • 北京南站附近的景點平臺推廣是什么工作
  • 專業(yè)網(wǎng)站建設(shè)價格網(wǎng)頁設(shè)計素材網(wǎng)站
  • 品牌網(wǎng)站建設(shè)9小蝌蚪9淘寶優(yōu)化
  • wordpress新建界面太原seo霸屏
  • 友情鏈接中有個網(wǎng)站域名過期了會影響seo系統(tǒng)培訓
  • 制作個人網(wǎng)站素材百度開戶公司
  • 尼樂清網(wǎng)站建設(shè)阿里網(wǎng)站seo
  • 正能量網(wǎng)站免費進入無需下載百度權(quán)重查詢
  • 雙井做網(wǎng)站的公司網(wǎng)絡(luò)整合營銷方案ppt
  • 網(wǎng)站建設(shè)要學哪些方面百度競價托管外包