06-09-2011 03:00 PM - edited 06-09-2011 03:02 PM
I've been trying to store audio into my SQLite database as a BLOB. I think that I'm having an issue converting the audio to bytes, however, as the value stored in the database is always in the following format:
Here is the code that I'm using:
InputStream responseData = connection.openInputStream();
byte data = IOUtilities.streamToBytes(responseData); System.out.println("DATA: " + data); // Value here is [B@d7266d3b DatabaseFunctions.setAudio(tid, data);
Is there some other way to convert the InputStream into bytes? The audio is a couple of seconds in length, there should be a lot more bytes...
By the way, I am using bind() when storing the actual bytes into the BLOB column of the database. But I think the problem lies before I do this.
Solved! Go to Solution.
06-09-2011 03:46 PM
What's the size of you byte. The problem may come from that.
You must be aware that a blob is limited at 4kb in the BB's implementation of SQLite. Bug already reported and the fix will not be dont at all.
05-19-2012 03:38 AM
Hello behrk, I am facing the same issue, what is the alternative you are using to save the music? How about storing it on filesystem? Is it correct approach?
05-19-2012 04:21 PM
I'm interested to know what the solution behrk found. But I think that using the file system is the only one, the cod file is limited to 8Mo of resources, so there is only the file system left.