SQLite如何在单个表格单元格中存储字节数组[重复](SQLite how to store a byte array in a single table cell [duplicate])

编程入门 行业动态 更新时间:2024-10-28 15:31:53
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 answer

I'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.

更多推荐

本文发布于:2023-08-06 04:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1444661.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数组   字节   单元格   表格   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!