Exemplo n.º 1
0
        //		private String[] SplitString(String aString)
        //		{
        //			return (new Regex(" ")).Split(aString);
        //		}

        /// <summary>
        /// Test method
        /// </summary>
        static void Main()
        {
            String inFile = "\\My Documents\\testBytes.txt";

            Console.WriteLine("Infile: " + inFile);
            ByteReader br = new ByteReader(inFile);

            br.OpenFile();
            bool gotByte = false;

            int[] i = new int[1];
            //byte[] b = new byte[1];

            do
            {
                //gotByte = br.ReadByte(b);
                gotByte = br.ReadInt(i);
                if (gotByte)
                {
                    Console.Write(i);
                }
                else
                {
                    Console.WriteLine("Could not read an int as bytes");
                }
            } while (gotByte);

            br.CloseFile();
        }
Exemplo n.º 2
0
        //        private String[] SplitString(String aString)
        //        {
        //            return (new Regex(" ")).Split(aString);
        //        }
        /// <summary>
        /// Test method
        /// </summary>
        static void Main()
        {
            String inFile = "\\My Documents\\testBytes.txt";
            Console.WriteLine("Infile: " + inFile);
            ByteReader br = new ByteReader(inFile);
            br.OpenFile();
            bool gotByte = false;
            int[] i = new int[1];
            //byte[] b = new byte[1];

            do
            {
                //gotByte = br.ReadByte(b);
                gotByte = br.ReadInt(i);
                if (gotByte)
                {
                    Console.Write(i);
                }
                else
                    Console.WriteLine("Could not read an int as bytes");
            } while (gotByte);

            br.CloseFile();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Sets up the next binary file to read the data from
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        private bool SetupNextFiles(int index)
        {
            if (br != null)
                br.CloseFile();

            br = null;
            string f = ((string)someBinaryFiles[index]);

            if (f != "")
            {
                br = new ByteReader(f);
                br.OpenFile();
                Console.WriteLine("Opening file for read: " + f);
            }

            if (br == null)
                return false;
            else
                return true;
        }