![]() ![]() It is rare, but that's what I'm dealing with here. If you're trying to parse a file format that stores partial-byte values or bit flags and don't re-align to byte boundaries often (which I think is rare) I'm sure there's some way to achieve this, whether it's a read-only view, being able to flip individual bits, or view ints and such in the data inspector. The author(s) of Hex Fiend are really clever and made an advanced yet still performant application. You either need to store them separately or leave them as bytes but find a way to read/write/shift bits efficiently, and again, this is just my unimaginative spitballing, but I can't come up with an easy answer to do this. Not if you read one byte and split it into 8 booleans :P Maybe I want to edit that.įor example, a boolean is kinda like a bit right? But it's 1 byte big. Maybe there's an unsigned integer that's 4 bits long at bit offset 7 (that's 1 bit in the first byte, and the other 3 in the next byte). You mentioned editing unaligned values, do you mean flipping individual bits between set/unset? Or being able to insert arbitrary numbers of bits in the middle of a file or filesystem?īoth. The UI part would take up the same space, but you would be loading less data from disk (theoretically) so it wouldn't be less efficient than the hex view in terms of disk usage, or UI memory. ![]() ![]() It feels unnecessarily convoluted, like there has got to be some easier way of reading binary data on a freaking binary computer, but, speaking for myself, I found lot of roadblocks just waiting for me to slam into them once I started brainstorming for details on the "how." If you're trying to parse a file format that stores partial-byte values or bit flags and don't re-align to byte boundaries often (which I think is rare) give writing a simple binary template, maybe just to read a single unaligned "uint4" at a known offset. For example, a boolean is kinda like a bit right? But it's 1 byte big. You mentioned editing unaligned values, do you mean flipping individual bits between set/unset? Or being able to insert arbitrary numbers of bits in the middle of a file or filesystem? Because the latter I really don't think is realistic. And you've probably heard this before, but a byte is the smallest addressable unit of memory in pretty much all modern computers. if you have 1000 bits to represent in 0's and 1's, the UI part is going to take pretty much the same amount it takes to represent 1000 nibbles in hexadecimal numerals.Īnd the other thing too, with Obj-C bits can be handled somewhat efficiently but it's still awkward. I'm not very experienced and maybe there's a clever solution to this but just because the text is binary, it doesn't mean it takes up less memory. Well sure we'd be loading less data at once but we're still exploding it into 0's and 1's. Unless you mean it takes a lot of power to separate those values into discrete 0s and 1s on screen. Can't you just load things on demand like you already do with the hex view? You'd just be loading less data at once because binary takes more space on screen, right? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |