import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.sql.Blob;
private void saveFile(String filePath, Blob content) throws Exception {
FileOutputStream fos = null;
BufferedOutputStream bos = null;
InputStream is = null;
BufferedInputStream bis = null;
try {
File file = new File(filePath);
fos = new FileOutputStream(file);
bos = new BufferedOutputStream(fos);
is = content.getBinaryStream();
bis = new BufferedInputStream(is);
int b1 = 0;
while ((b1 = bis.read()) != -1) {
bos.write(b1);
bos.flush();
}
} catch (Exception e) {
throw e;
} finally {
if(is!=null){
is.close();
}
if (bis != null) {
bis.close();
}
if (fos != null) {
fos.close();
}
if (bos != null) {
bos.close();
}
}
}
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.sql.Blob;
private void saveFile(String filePath, Blob content) throws Exception {
FileOutputStream fos = null;
BufferedOutputStream bos = null;
InputStream is = null;
BufferedInputStream bis = null;
try {
File file = new File(filePath);
fos = new FileOutputStream(file);
bos = new BufferedOutputStream(fos);
is = content.getBinaryStream();
bis = new BufferedInputStream(is);
int b1 = 0;
while ((b1 = bis.read()) != -1) {
bos.write(b1);
bos.flush();
}
} catch (Exception e) {
throw e;
} finally {
if(is!=null){
is.close();
}
if (bis != null) {
bis.close();
}
if (fos != null) {
fos.close();
}
if (bos != null) {
bos.close();
}
}
}