public static byte[] readFully(InputStream input) throws IOException {

byte[] buffer = new byte[8192];

int bytesRead;

ByteArrayOutputStream output = new ByteArrayOutputStream();

while ((bytesRead = input.read(buffer)) != -1) {

output.write(buffer, 0, bytesRead);

}

return output.toByteArray();

}

 

 

 

 

創作者介紹
創作者 攝即是空 的頭像
小彬彬

攝即是空

小彬彬 發表在 痞客邦 留言(0) 人氣( 39 )