I have a binary file with a bit stream I need to modify. I need to change certain bits based on user input. An example in listed below. I can read the data into a byte array, but I'm not sure how to manipulate the data and then write it back out to a file. I need to preserve any leading zeros.