ByteArrayOutputStream output = new ByteArrayOutputStream();
fss.download( "0000", fileEntity.getFjdz(), output, 999999999 );ByteArrayInputStream inputStream = new ByteArrayInputStream( output.toByteArray() );
int contentLength = output.size();
output.flush();
output.close();
HttpHeaders headers = new HttpHeaders();
headers.add( "Cache-Control", "no-cache, no-store, must-revalidate" );
headers.add( "Content-Disposition", "attachment; filename=" + new String( fileEntity.getFjmc().getBytes(), "ISO-8859-1" ) );
headers.add( "Pragma", "no-cache" );
headers.add( "Expires", "0" );
return ResponseEntity.ok().headers( headers ).contentLength( contentLength ).contentType( MediaType.parseMediaType( "application/octet-stream" ) )
.body( new InputStreamResource( inputStream ) );