Книга: Beginning Android
Beware of the BLOB!
Beware of the BLOB!
Binary large objects — BLOBs — are supported in many databases, including SQLite. However, the Android model is more aimed at supporting such hunks of data via their own separate content Uri
values. A content provider, therefore, does not provide direct access to binary data, like photos, via a Cursor
. Rather, a property in the content provider will give you the content Uri
for that particular BLOB. You can use getInputStream()
and getOutputStream()
on your ContentProvider
to read and write the binary data.
Quite possibly, the rationale is to minimize unnecessary data copying. For example, the primary use of a photo in Android is to display it to the user. The ImageView
widget can do just that, via a content Uri
to a JPEG. By storing the photo in a manner that has its own Uri
, you do not need to copy data out of the content provider into some temporary holding area just to be able to display it — just use the Uri
. The expectation, presumably, is that few Android applications will do much more than upload binary data and use widgets or built-in activities to display that data.
- Новые функции API для работы с Blob и массивами
- 4.4.4 The Dispatcher
- About the author
- Chapter 7. The state machine
- Appendix E. Other resources and links
- Example NAT machine in theory
- The final stage of our NAT machine
- Compiling the user-land applications
- The conntrack entries
- Untracked connections and the raw table
- Basics of the iptables command
- Other debugging tools