Java上传的视频的文件无法打开问题 丢失了什么?
InputStreamin=request.getInputStream();Strings="";ByteArrayOutputStreambaos=newByteAr...
InputStream in=request.getInputStream();
String s="";
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int picint;
while ((picint = in.read()) != -1) {
baos.write(picint);
}
in.close();
byte[] picbyte = baos.toByteArray();
baos.close();
FileOutputStream fout=new FileOutputStream(new File("hello.up"));
fout.write(picbyte);
fout.close(); 展开
String s="";
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int picint;
while ((picint = in.read()) != -1) {
baos.write(picint);
}
in.close();
byte[] picbyte = baos.toByteArray();
baos.close();
FileOutputStream fout=new FileOutputStream(new File("hello.up"));
fout.write(picbyte);
fout.close(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询