Wrap an ArrayBuffer to make it work like a binary string.
ArrayBuffer and TypedArrays (like Uint8Array) are much better alternatives and are now supported in just about all browsers.
But sometimes the data you are working with does actually include ASCII text, and you need to string methods like indexOf() and slice().
This is an incomplete implementation. I wrote only the methods I had an immediate need for in FirefoxOS. I'm posting it here in the hopes that someone will fork it and flesh it out. With a full-featured implementation, it should be possible to port all the legacy code out there that is still using binary strings.