/// <summary>
        /// Factory method to creates a new, empty sequential access file.
        /// </summary>
        public static SequentialFile Create(string filepath, int recordlength)
        {
            //create new instance
            SequentialFile file = new SequentialFile();

            //set file path & record length
            file.FilePath = filepath;
            file.RecordLength = recordlength;

            //create file, init stream, reader & writer
            file.fs = new FileStream(file.FilePath, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None, file.RecordLength);

            //write metadata to file header
            file.WriteHeader();

            //set isopen flag to true
            file.IsOpen = true;

            //return file to caller
            return file;
        }
        /// <summary>
        /// Factory method to open an existing sequential access file.
        /// </summary>
        public static SequentialFile Open(string filepath)
        {
            //create new instance
            SequentialFile file = new SequentialFile();

            //set file path
            file.FilePath = filepath;

            //read file header
            file.ReadHeader();

            //open file & init stream
            file.fs = new FileStream(file.FilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.None, file.RecordLength);

            //set isopen flag to true
            file.IsOpen = true;

            //return file to caller
            return file;
        }