示例#1
0
        public static void Head(String filePath, Int32 bytes)
        {
            if (!File.Exists(filePath))
            {
                throw new Exception("File doesn't exists.");
            }

            using (FileStream handle = File.OpenRead(filePath))
            {
                var data = CInterop.ReadToEndAsASCII(handle);
                Console.WriteLine(String.Join(" ", data.Take(bytes).Select(ch => ch + $"({( ( Int32 ) ch ).ToString ( "X2" )})")));
            }
        }
示例#2
0
 public GLuaLexer(Stream input) : this(CInterop.ReadToEndAsASCII(input))
 {
 }