public static string ReadASCIIZ(this Stream s) { var bytes = new List<byte>(); byte b; while ((b = s.ReadUInt8()) != 0) bytes.Add(b); return new string(Encoding.ASCII.GetChars(bytes.ToArray())); }