SQLite如何在单个表格单元格中存储字节数组[重复](SQLite how to store a byte array in a single table cell [duplicate])
这个问题在这里已有答案:
如何在Sqlite中将图像存储为blob以及如何检索它? 6个答案 如何在SQLite数据库中存储和检索字节数组(图像数据)? 1个答案我正在使用SQLite数据库来存储我的Android数据。 如何在单个单元格中存储字节数组byte []。 因为只有int或strings类型。
我听说过有关BLOB的事情,也许你能解释一下吗?
另一种选择是将字节数组转换为字符串,并在使用时将其转换回来。 我怎样才能做到这一点?
This question already has an answer here:
how to store Image as blob in Sqlite & how to retrieve it? 6 answers How to store and retrieve a byte array (image data) to and from a SQLite database? 1 answerI'm using SQLite database to store my Android data. How can i store a byte array byte[] in a single cell. Because there are only types as int or strings.
I heard something about BLOB, maybe you can explain it to me?
Another option is to convert the byte array to a string and convert it back when using it. How can I do this?
最满意答案
与其他类型一样, ContentValues.put()和Cursor.getBlob()函数直接支持字节数组。
Byte arrays are directly supported, like the other types, by the ContentValues.put() and Cursor.getBlob() functions.
更多推荐
发布评论