android sqlite中存放字节数组的方法

来源:互联网 发布:军师联盟 李晨演技知乎 编辑:程序博客网 时间:2024/05/23 00:05

两种方法sqlite实现字节数组存放:

1、BLOB - The value is a blob of data, stored exactly as it was input.(BLOB数据不做任何转换,以输入形式存储。)

2、将字节数组转为string类型存放

Base64.encodeToString(rawData, Base64.DEFAULT) byte[]转为string

Base64.decode(printData.getBytes(), Base64.DEFAULT) string转为byte[]

1 0
原创粉丝点击