title: How to remove BOM from byte array
body: <p>I have <code>xml</code> data in <code>byte[] byteArray</code> which may or mayn't contain BOM. Is there any standard way in C# to remove BOM from it? If not, what is the best way, which handles all the cases including all types of encoding, to do the same?</p>
  
  <p>Actually, I am fixing a bug in the code and I don't want to change much of the code. So it would be better if someone can give me the code to remove BOM.</p>
  
  <p>I know that I can do like find out <code>60</code> which is ASCII value of '&lt;' and ignore bytes before that but I don't want to do that.</p>