private String ReadTextFile(String inFile, Int32 length) { Byte[] fileData = ReadFile(inFile, length); String text = null; // is the a Binary Plist? // if (BSubString(fileData,0,6) if (System.Text.Encoding.ASCII.GetString(Hex.BSubString(fileData, 0, 6)).Equals("bplist")) { text = DecodePListData(fileData); } else { text = System.Text.Encoding.ASCII.GetString(fileData); } if (text == null) { return(null); } else { return(String.Join(Environment.NewLine, text.Split('\n'))); } }