Beispiel #1
0
        static void Main()
        {
            //stvara instancu APIFileReader
            //i prosljedjuje ime postojece datoteke
            APIFileReader fileReader = new APIFileReader("myTestFile.txt");

            //stvara medjuspremink i ASCII koder
            const int bufferSize = 128;

            byte[]        buffer       = new byte[bufferSize];
            ASCIIEncoding asciiEncoder = new ASCIIEncoding();

            //ucitava datoteku u medjuspremik i prikazjue na konzolu
            while (fileReader.Read(buffer, 0, bufferSize) != 0)
            {
                Console.WriteLine("{0}", asciiEncoder.GetString(buffer));
            }
        }
Beispiel #2
0
        public static void Main()
        {
            // create an instance of the APIFileReader,
            // pass in the name of an existing file
            APIFileReader fileReader =
                new APIFileReader("myTestFile.txt");

            // create a buffer and an ASCII coder
            const int BuffSize = 128;

            byte[]        buffer       = new byte[BuffSize];
            ASCIIEncoding asciiEncoder = new ASCIIEncoding();

            // read the file into the buffer and display to console
            while (fileReader.Read(buffer, 0, BuffSize) != 0)
            {
                Console.Write("{0}", asciiEncoder.GetString(buffer));
            }
        }