原文:byte數組和File,InputStream互轉

將File FileInputStream 轉換為byte數組: File file new File file.txt InputStream input new FileInputStream file byte byt new byte input.available input.read byt 將byte數組轉換為InputStream: byte byt new byte Input ...

2016-09-08 10:53 0 6100 推薦指數:

查看詳情

byte[]和InputStream的相互轉

1:byte[]轉換為InputStream InputStream sbs = new ByteArrayInputStream(byte[] buf); 2:InputStream轉換為InputStreambyte[] ByteArrayOutputStream swapStream ...

Sat Jun 22 17:18:00 CST 2019 0 8063
byte[]和InputStream的相互轉

1:byte[]轉換為InputStream InputStream sbs = new ByteArrayInputStream(byte[] buf); 2:InputStream轉換為InputStreambyte[] ByteArrayOutputStream swapStream ...

Sun Jan 22 20:26:00 CST 2017 0 56280
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM