Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> BLOB slow writing, fast reading??
Hi
Can anyone tell me why it takes about 20 minutes til write 0.5MB to a BLOB field, where reading from a BLOB field with 0.5MB only takes 20 seconds???
This is my writing code (using Java2, and classes12.zip)
oracle.sql.BLOB blob =
((oracle.jdbc.driver.OracleResultSet)resl).getBLOB(1);
OutputStream out = blob.getBinaryOutputStream();
ByteArrayInputStream in = new ByteArrayInputStream(designFile.file);
byte[] file = new byte[8000];
int read = 0;
while ( (read = in.read(file, 0, file.length)) != -1 )
out.write(file, 0, read);
out.close();
And this is my read code :
oracle.sql.BLOB blob =
((oracle.jdbc.driver.OracleResultSet)resl).getBLOB(1);
BufferedInputStream in = new
BufferedInputStream(blob.getBinaryStream());
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] file = new byte[8000];
int read = 0;
while ((read = in.read(file, 0, file.length)) > 0)
out.write(file, 0, read);
in.close();
--
Venlig hilsen
Frederik
Received on Fri Oct 29 1999 - 01:53:24 CDT