Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a good data type for representing arbitrary binary data?

Tags:

mercury

I want to read binary data from disk and store it in a Mercury variable. According to the string library, strings don't allow embedded null bytes and store content with UTF-8 encoding so I don't think that will work. The best I've found so far is a line in the bitmap library that says, "Accessing bitmaps as if they are an array of eight bit bytes is especially efficient"

Are bitmaps a good way to store arbitrary binary data? Is there something better?

like image 784
mndrix Avatar asked Jan 30 '26 20:01

mndrix


1 Answers

Yes, bitmaps are the recommended way to read/write/store binary data.

like image 53
Paul Bone Avatar answered Feb 03 '26 09:02

Paul Bone



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!