CSharp examples for System.IO:BinaryReader
Read String from BinaryReader
using System.Text; using System.IO;//www . ja v a2 s . c om using System.Globalization; using System; public class Main{ public static string ReadNtString(this BinaryReader br) { var sb = new StringBuilder(); short ch; while (br.BaseStream.Position < br.BaseStream.Length && (ch = br.ReadInt16()) != 0) sb.Append((char)ch); return sb.ToString(); } }