Beispiel #1
0
        public static IExcelDataReader CreateBinaryReader(Stream fileStream)
        {
            IExcelDataReader reader = new ExcelBinaryReader();

            reader.Initialize(fileStream);
            return(reader);
        }
		/// <summary>
		/// Creates an instance of <see cref="ExcelBinaryReader"/>
		/// </summary>
		/// <param name="fileStream">The file stream.</param>
		/// <returns></returns>
		public static IExcelDataReader CreateBinaryReader(Stream fileStream, ReadOption option)
		{
			IExcelDataReader reader = new ExcelBinaryReader(option);
			reader.Initialize(fileStream);

			return reader;
		}
        /// <summary>
        /// Creates an instance of <see cref="ExcelBinaryReader"/>
        /// </summary>
        /// <param name="fileStream">The file stream.</param>
        /// <param name="convertOADate"></param>
        /// <returns></returns>
        public static IExcelDataReader CreateBinaryReader(Stream fileStream, bool convertOADate)
        {
            var reader = new ExcelBinaryReader();

            reader.ConvertOaDate = convertOADate;
            reader.Initialize(fileStream);
            return(reader);
        }
        /// <summary>
        /// Creates an instance of <see cref="ExcelBinaryReader"/>
        /// </summary>
        /// <param name="fileStream">The file stream.</param>
        /// <returns></returns>
        public static IExcelDataReader CreateBinaryReader(Stream fileStream, ReadOption option)
        {
            var reader = new ExcelBinaryReader();

            reader.ReadOption = option;
            reader.Initialize(fileStream);
            return(reader);
        }
 public SequenceFileReader(string filename)
 {
     this.HasFile = File.Exists(filename);
     if(HasFile)
     {
         _input = new FileStream(filename, FileMode.Open, FileAccess.Read);
         _reader = ExcelReaderFactory.CreateBinaryReader(_input) as ExcelBinaryReader;
     }
 }
Beispiel #6
0
		public static IExcelDataReader CreateReader(Stream fileStream, ExcelFileType excelFileType)
		{
			IExcelDataReader reader = null;

			switch (excelFileType)
			{
				case ExcelFileType.Binary:
					reader = new ExcelBinaryReader();
					reader.Initialize(fileStream);
					break;
				case ExcelFileType.OpenXml:
					reader = new ExcelOpenXmlReader();
					reader.Initialize(fileStream);
					break;
				default:
					break;
			}

			return reader;
		}
Beispiel #7
0
        public static IExcelDataReader CreateReader(Stream fileStream, ExcelFileType excelFileType)
        {
            IExcelDataReader reader = null;

            switch (excelFileType)
            {
            case ExcelFileType.Binary:
                reader = new ExcelBinaryReader();
                reader.Initialize(fileStream);
                break;

            case ExcelFileType.OpenXml:
                reader = new ExcelOpenXmlReader();
                reader.Initialize(fileStream);
                break;

            default:
                break;
            }

            return(reader);
        }