This will read the stream 1 byte at a time, regardless of size. You can check for certain bytes to omit them, like the BOM marker. It reads 1 byte at a time, and when it reaches the linefeed, it creates a line array of bytes. You can just loop the bdx to build a byte array. I think this is what your trying to do, but I'm not clear on your intentions.
But you should get the principle of reading a file at the more advanced level, in which you can work and alter the data.
Sorry about the VB, that what I write in. the principle should be the same in c-sharp.
'Read the Html Template from App_Data, and format the template fields
htmlStream = New FileStream(m_PhysicalPath, FileMode.Open, FileAccess.Read)
Dim htmlLen As Long = htmlStream.Length
Dim fileData As Byte() = New Byte(htmlLen) {}
htmlStream.Read(fileData, 0, htmlLen)
If Not (htmlStream Is Nothing) Then htmlStream.Close()
Dim byteLine() As Byte = New Byte() {}
Dim strArray() As String = New String() {}
For bdx As Integer = 0 To fileData.Length - 1
Dim byteVal As Byte = fileData(bdx)
If Not (byteVal = &HD) Then
Array.Resize(byteLine, byteLine.Length + 1)
byteLine(byteLine.Length - 1) = byteVal
Else
Array.Resize(byteLine, byteLine.Length + 1)
byteLine(byteLine.Length - 1) = byteVal
Dim charLine() As Char = New Char() {}
Array.Resize(charLine, byteLine.Length + 1)
For cdx As Integer = 0 To byteLine.Length - 1
charLine(cdx) = AsciiByteToChar(byteLine(cdx))
Next
Dim value As String = New String(charLine)
Array.Resize(strArray, strArray.Length + 1)
strArray(strArray.Length - 1) = value
Array.Resize(byteLine, 0)
bdx += 1
End If
Next
' ' Remove the BOM Marker
strArray(0) = Right(strArray(0), strArray(0).Length - 3)
'