-
字節(jié)字符轉(zhuǎn)換流 Java中的 文本(char)是 16 位無符號(hào)整數(shù),是字符的 unicode 編碼(雙字節(jié)編碼) 文件是 byte byte byte ...的數(shù)據(jù)序列 文本文件是文本(char)序列按照某種編碼方案(utf-8,utf-16be,gbk)序列化位 byte 的存儲(chǔ)結(jié)果查看全部
-
字節(jié)緩沖流(提高IO的性能) BufferedInputStream、BufferedOutputStream BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file)); FileOutputStream->write() DataOutputStream->writeXxx(); BufferedOutputStream->write();效率最高查看全部
-
數(shù)據(jù)輸入輸出流: DataInputStream、DataOutputStream 是對(duì)“流”功能的擴(kuò)展,方便讀寫 DataOutputStream dos = new DataOutputStream(new FileOutputStream(file)); dos.writeInt(10); dos.writeLong(10l);字母l dos.writeDouble(10.5); //采用utf-8編碼寫出 dos.writeUTF("中國"); //采用utf-16be編碼寫出 dos.writeChars("中國");查看全部
-
文件寫出流: FileOutputStream fos = new FileOutputStream(file,true) 文件不存在,則創(chuàng)建,存在,則刪除后創(chuàng)建查看全部
-
1、byte 類型 8 位,int 類型 32 位,為了避免數(shù)據(jù)轉(zhuǎn)換錯(cuò)誤,通過 & 0xff 將高 24 位清零 2、long time = System.currentTimeMillis() 當(dāng)前時(shí)間與協(xié)調(diào)世界時(shí) 1970 年 1 月 1 日午夜之間的時(shí)間差(以毫秒為單位測(cè)量) 3、is.read() 單字節(jié)適合讀取 小 文件 is.read(byte[] bytes,int star,int size) 字節(jié)數(shù)組適合讀取 大 文件查看全部
-
字節(jié)流:文件流(File)、數(shù)據(jù)流(Data) 文件讀取流: FileInputStream fis = new FileInputStream(fileName) 注意補(bǔ)零: 0xf(16) = 16(10)查看全部
-
IO流(字節(jié)流、字符流) 字節(jié)流的輸入輸出方式:InputStream和OutputStream 輸入流基本方法: is.read() 讀取一個(gè)字節(jié)無符號(hào)填充到int低八位,-1是EOF is.read(byte[] buf) is.read(byte[] buf,int start,int size) 輸出流基本方法: os.write(int b) 寫出一個(gè)byte到流,b的低8位 os.write(byte[] buf) os.write(byte[] buf,int start,int size)查看全部
-
file 類不操作文件內(nèi)容查看全部
-
序列化基本操作查看全部
-
FileInputStream->具體實(shí)現(xiàn)了在文件上的讀取數(shù)據(jù)查看全部
-
字節(jié)流(續(xù)2)查看全部
-
字節(jié)流(續(xù))查看全部
-
字節(jié)流查看全部
-
IO流 IO流包括輸入流,輸出流,是java做數(shù)據(jù)輸入輸出的基礎(chǔ) IO流又可以分為字節(jié)流和字符流查看全部
-
RandomAccessFile查看全部
舉報(bào)
0/150
提交
取消