日期:2014-05-17 浏览次数:20741 次
Blob blob=rs.getBlob("thefile");
InputStreamfileInputStream=new BufferedInputStream(blob.getBinaryStream());
byte[]bytes =new byte[(int)blob.length()];
int len=bytes.length;
s=len;
int offset = 0;
int read = 0;
while (offset < len && (read =fileInputStream.read(bytes, offset,len)) >= 0) {
offset += read;
}
fileInputStream=new ByteArrayInputStream(bytes);