SwfDotNet.IO.SwfReader.Init C# (CSharp) Method

Init() private method

Inits the stream reading process.
private Init ( string path, bool useBuffer ) : void
path string Path.
useBuffer bool Use buffer.
return void
        private void Init(string path, bool useBuffer)
        {
            Stream stream = File.OpenRead(path);
            if (useBuffer)
            {
                FileInfo fi = new FileInfo(path);

                byte[] buff = new byte[fi.Length];
                stream.Read(buff, 0, System.Convert.ToInt32(fi.Length));
                stream.Close();

                MemoryStream ms = new MemoryStream(buff);
                this.br = new BufferedBinaryReader(ms);
            }
            else
            {
                this.br = new BufferedBinaryReader(stream);
            }
        }