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?
Yes, bitmaps are the recommended way to read/write/store binary data.