Question

I am in a design phase of an editor project. I always store files in binary format. However the requirement is, user must be able to click a button "Display Format" and the format of the file content should change from Binary to Hex, Decimal and vice-versa. What is the best way to do this? My files are really huge ones.

Était-ce utile?

La solution

I would not read the file into memory but instead just keep an eye on where the offset of the top left corner of your editor is. Then just use random file access using Stream.Seek and to read that part of the file when needed and display it to the end user.

The actual conversion from hex, binary and octal is easy and the System.Convert.ToString(byte, int) is your friend here.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top