SQLite doesn't support streaming BLOB or CLOB data. You have four options: Convert the InputStream to a byte. This will only work if you have enough memory (see below) Use FileOutputStream or an Android API that supports streaming Split the data into small blocks and store then in SQLite Use a database that works on Android and supports streaming.
I only know the H2 database But be aware the Android support for H2 is very new. In that case, you need to use the JDBC API, and you probably want to enable LOBs in the database otherwise each large BLOB is stored in a separate file To convert an InputStream to a byte array, you could use: public static byte readBytesAndClose(InputStream in) throws IOException { try { int block = 4 * 1024; ByteArrayOutputStream out = new ByteArrayOutputStream(block); byte buff = new byteblock; while (true) { int len = in. Read(buff, 0, block); if (len Write(buff, 0, len); } return out.toByteArray(); } finally { in.close(); } }.
SQLite doesn't support streaming BLOB or CLOB data. You have four options: Convert the InputStream to a byte. This will only work if you have enough memory (see below).
Use FileOutputStream or an Android API that supports streaming Split the data into small blocks and store then in SQLite Use a database that works on Android and supports streaming. I only know the H2 database. But be aware the Android support for H2 is very new.In that case, you need to use the JDBC API, and you probably want to enable LOBs in the database, otherwise each large BLOB is stored in a separate file.
To convert an InputStream to a byte array, you could use: public static byte readBytesAndClose(InputStream in) throws IOException { try { int block = 4 * 1024; ByteArrayOutputStream out = new ByteArrayOutputStream(block); byte buff = new byteblock; while (true) { int len = in. Read(buff, 0, block); if (len Write(buff, 0, len); } return out.toByteArray(); } finally { in.close(); } }.
– mlevit Sep 4 '10 at 8:35 Of course you can convert an InputStream to a byte, but only if the byte array actually fits in memory. Let me add the code for that. – Thomas Mueller Sep 5 '10 at 17:50.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.