Question Int, Hex, String -> Binary? (11001101 etc.)

Vermiculus

Well-known member
Joined
Jul 28, 2008
Messages
55
Location
Baltimore
Programming Experience
1-3
I am trying to create a compression program that uses the bitstream, but I can't seem to be able to access it through any included function. I know the ---.ReadAllBytes function, but that gives me the integer code for the character, whereas I need the actually binaries (100101110111001011101....)

Is there any function that can convert these types? I know it would probably return a string, since the int would be too large :)

If I end up needing to create my own I will try to remember to post the code with the prefix resolved.
 
Yes, smallest .Net data type is Byte, to get bits you can convert it to a string displaying the base 2 representation of the value with Convert.ToString (datatype,base), or use the BitArray class.
 
It wouldn't be any different, as you wouldn't do any processing work in UI thread anyway.
 
I am trying to create a compression program
care to run through your algorithm?

I ask because i think there's something fundamental youre missing regards the whole int/binary thing; if you can explain how having a bitstream rather than an int helps your compression, i'll be able to tell
 
Back
Top