看板 AndroidDev 關於我們 聯絡資訊
我想要讀入一個未知大小的檔案, 並讀入buffer ,分成4MB 為一個byte array 該怎麼寫會比較好!?卡關卡很久 FileInputStream fileInputStream = null; FileOutputStream fileOutputStream = null; byte[] buffer = new byte[available()]; while((length = fileInputStream.read(buffer)) != -1) { // 將陣列資料寫入目的檔案 fileOutputStream.write(buffer, 0, length); } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 1.169.169.30 ※ 編輯: mib30213 來自: 1.169.169.30 (06/04 22:02)