mndrix
mndrix

Reputation: 3198

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

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?

Upvotes: 3

Views: 1209

Answers (1)

Paul Bone
Paul Bone

Reputation: 822

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

Upvotes: 4

Related Questions