Here's some code I hacked up that seems to retain the entire bytes of a file (less any string replacements), regardless of any mixture of line terminators.
It's in VB.NET; translating it to C# may increase performance (I read the System.IO in C# has better perf.)
Not sure how to format code yet from my VS2008 IDE??
Private Sub doIt()
Dim encode As System.Text.Encoding = System.Text.Encoding.GetEncoding("utf-8")
Dim st As New FileStream(TextBox1.Text, FileMode.Open, FileAccess.Read)
Dim br As New BinaryReader(st, encode)
Dim wst As New FileStream(TextBox2.Text, FileMode.Create, FileAccess.ReadWrite)
Dim bw As New StreamWriter(wst, encode)
Dim byt As Integer
Dim iC As Int64, iL As Int64
iL = st.Length - 1
Dim strLine As String = ""
'Dim sb As New System.Text.StringBuilder(5000000)
Dim strFind As String = "/MediaType(AUX)"
Dim strReplace As String = "/MediaPosition 3 /TraySwitch false"
For iC = 0 To iL
byt = br.ReadByte
strLine &= Chr(byt)
Select Case byt
Case 10
strLine = strLine.Replace(strFind, strReplace)
bw.Write(strLine)
strLine = ""
Case Else
End Select
If iC = iL Then
bw.Write(strLine)
End If
Next
bw.Close()
wst.Close()
br.Close()
st.Close()
TextBox3.Text = "Finished"
End Sub