创建一个接口,将HttpMarsResponse作为参数传入
public void downLoad(HttpMarsResponse response) {
try {
File file = new File("/Users/yuye/Desktop/demo.mov");
InputStream inputStream = new FileInputStream(file);
response.downLoad("文件名.后缀",inputStream);
} catch (Exception e){
}
}
其实就是调用这个方法就好了,然后接口返回类型要设置成void
response.downLoad("文件名.后缀",inputStream);