ファイルストリームをバイト配列に変換
330 ワード
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] b = new byte[1024];
int i = 0;
InputStream is = new FileInputStream(upload);
while((i = is.read(b)) != -1){
baos.write(b, 0, i);
}
byte[] b1 = baos.toByteArray();