/// <summary> /// Opens a file identified by a URI for read or write. /// </summary> /// <param name="uri"></param> /// <param name="mode"></param> /// <returns></returns> /// <remarks> /// If not set explicitly through properties, compression and archival settings /// are figured out automatically from the file extension. /// </remarks> public Stream Open(Uri uri, DataFileMode mode) { this.uri = uri; this.mode = mode; return(Open()); }
public SqlServerNativeDataFile(Stream stream, DataFileMode fileMode) : base(stream, fileMode) { InitializeMembers(); Open(); }
public SqlServerNativeDataFile(Uri uri, DataFileMode fileMode) : base(uri, fileMode) { InitializeMembers(); Open(); }
public DelimitedTextDataFile(Stream stream, DataFileMode fileMode, Encoding encoding, CultureInfo culture) : base(stream, fileMode, encoding, culture) { InitializeMembers(new StreamingContext()); Open(); }
/// <summary> /// Opens a file by wrapping a stream. /// </summary> /// <param name="stream"></param> /// <param name="mode"></param> /// <param name="compression"></param> protected void OpenExternalStream(Stream stream, DataFileMode fileMode) { this.baseStream = stream; this.ownsBaseStream = false; this.fileMode = fileMode; }
/// <summary> /// Constructs a file and opens a stream automatically. /// </summary> /// <param name="uri"></param> /// <param name="fileMode"></param> /// <param name="compression"></param> protected DataFileBase(Uri uri, DataFileMode fileMode) { InitializeMembers(new StreamingContext()); this.uri = uri; this.fileMode = fileMode; }
public CsvFile(Stream stream, DataFileMode fileMode, CompressionMethod compression, Encoding encoding, CultureInfo culture) : base(stream, fileMode, compression, encoding, culture) { InitializeMembers(); Open(); }
protected FormattedDataFileBase(Stream stream, DataFileMode fileMode, Encoding encoding, CultureInfo culture) : base(stream, fileMode) { InitializeMembers(new StreamingContext()); this.encoding = encoding; this.culture = culture; }
protected FormattedDataFile(Stream stream, DataFileMode fileMode, CompressionMethod compression, Encoding encoding, CultureInfo culture) : base(stream, fileMode, compression) { InitializeMembers(); this.encoding = encoding; this.culture = culture; }
/// <summary> /// Opens a file identified by a URI for read or write. /// </summary> /// <param name="uri"></param> /// <param name="mode"></param> /// <param name="compression"></param> /// <param name="archival"></param> /// <returns></returns> public Stream Open(Uri uri, DataFileMode mode, DataFileCompression compression, DataFileArchival archival) { this.uri = uri; this.mode = mode; this.compression = compression; this.archival = archival; return(Open()); }
/// <summary> /// Initializes private member variables. /// </summary> private void InitializeMembers() { this.uri = null; this.mode = DataFileMode.Read; this.compression = DataFileCompression.Automatic; this.archival = DataFileArchival.Automatic; this.userName = null; this.password = null; }
/// <summary> /// Opens a file by wrapping an external file stream /// </summary> /// <param name="stream"></param> /// <param name="fileMode"></param> public void Open(Stream stream, DataFileMode fileMode) { if (stream == null) { throw new ArgumentNullException("stream"); // TODO } OpenExternalStream(stream, fileMode); Open(); }
/// <summary> /// Opens a file by opening a new stream. /// </summary> /// <param name="uri"></param> /// <param name="fileMode"></param> public void Open(Uri uri, DataFileMode fileMode) { if (uri == null) { throw new ArgumentNullException("uri"); // TODO } this.uri = uri; this.fileMode = fileMode; Open(); }
private void InitializeMembers(StreamingContext context) { this.baseStream = null; this.ownsBaseStream = false; this.streamFactoryType = null; this.fileMode = DataFileMode.Unknown; this.uri = null; this.generateIdentityColumn = false; this.blocks = new List <DataFileBlockBase>(); this.blockCounter = -1; }
private void CopyMembers(DataFileBase old) { this.baseStream = null; this.ownsBaseStream = false; this.fileMode = old.fileMode; this.uri = old.uri; this.generateIdentityColumn = old.generateIdentityColumn; // Deep copy of blocks this.blocks = new List <DataFileBlockBase>(); foreach (var b in old.blocks) { var nb = (DataFileBlockBase)b.Clone(); this.blocks.Add((DataFileBlockBase)b.Clone()); } this.blockCounter = -1; }
protected void Open(DataFileMode fileMode, DataFileArchival archival) { EnsureNotOpen(); if (baseStream == null) { // Open input stream // Check if the archival option is turned on and open archive // file if necessary by opening an IArchiveInputStream var sf = GetStreamFactory(); sf.Uri = uri; sf.Mode = fileMode; sf.Archival = archival; // TODO: add authentication options here baseStream = sf.Open(); ownsBaseStream = true; } else { // Do nothing } }
public DelimitedTextDataFile(Uri uri, DataFileMode fileMode) : this(uri, fileMode, Encoding.ASCII, CultureInfo.InvariantCulture) { // Overload }
/// <summary> /// Opens a file identified by a URI for read or write. /// </summary> /// <param name="uri"></param> /// <param name="mode"></param> /// <param name="compression"></param> /// <param name="archival"></param> /// <returns></returns> public Stream Open(Uri uri, DataFileMode mode, DataFileCompression compression, DataFileArchival archival) { this.uri = uri; this.mode = mode; this.compression = compression; this.archival = archival; return Open(); }
public CsvFile(Uri uri, DataFileMode fileMode) : this(uri, fileMode, CompressionMethod.Automatic) { // Overload }
private void InitializeMembers(StreamingContext context) { this.baseStream = null; this.ownsBaseStream = false; this.streamFactoryType = null; this.fileMode = DataFileMode.Unknown; this.uri = null; this.generateIdentityColumn = false; this.blocks = new List<DataFileBlockBase>(); this.blockCounter = -1; }
public CsvFile(Uri uri, DataFileMode fileMode, CompressionMethod compression) : this(uri, fileMode, compression, Encoding.ASCII, CultureInfo.InvariantCulture) { // Overload }
/// <summary> /// Constructs a file and opens a stream automatically /// </summary> /// <param name="uri"></param> /// <param name="fileMode"></param> /// <param name="compression"></param> protected DataFileBase(Uri uri, DataFileMode fileMode, CompressionMethod compression) { InitializeMembers(); this.uri = uri; this.fileMode = fileMode; this.compression = compression; }
protected TextDataFileBase(Uri uri, DataFileMode fileMode, Encoding encoding, CultureInfo culture) : base(uri, fileMode, encoding, culture) { InitializeMembers(); }
protected TextDataFileBase(Stream stream, DataFileMode fileMode, Encoding encoding, CultureInfo culture) : base(stream, fileMode, encoding, culture) { InitializeMembers(); }
/// <summary> /// Constructs a file object around an already open stream. /// </summary> /// <param name="stream"></param> /// <param name="fileMode"></param> protected DataFileBase(Stream stream, DataFileMode fileMode) { InitializeMembers(new StreamingContext()); OpenExternalStream(stream, fileMode); }
protected TextDataFile(Uri uri, DataFileMode fileMode, CompressionMethod compression, Encoding encoding, CultureInfo culture) : base(uri, fileMode, compression, encoding, culture) { InitializeMembers(); }
private void CopyMembers(DataFileBase old) { this.baseStream = null; this.ownsBaseStream = false; this.fileMode = old.fileMode; this.uri = old.uri; this.generateIdentityColumn = old.generateIdentityColumn; // Deep copy of blocks this.blocks = new List<DataFileBlockBase>(); foreach (var b in old.blocks) { var nb = (DataFileBlockBase)b.Clone(); this.blocks.Add((DataFileBlockBase)b.Clone()); } this.blockCounter = -1; }
public CsvFile(Stream stream, DataFileMode fileMode) : this(stream, fileMode, CompressionMethod.None, Encoding.ASCII, CultureInfo.InvariantCulture) { // Overload }
private void InitializeMembers() { this.baseStream = null; this.ownsBaseStream = false; this.uncompressedStream = null; this.fileMode = DataFileMode.Unknown; this.compression = CompressionMethod.None; this.uri = null; this.blocks = new List<DataFileBlockBase>(); this.blockCounter = -1; }
public DelimitedTextDataFile(Stream stream, DataFileMode fileMode) : this(stream, fileMode, Encoding.ASCII, CultureInfo.InvariantCulture) { // Overload }
/// <summary> /// Opens a file by wrapping a stream. /// </summary> /// <param name="stream"></param> /// <param name="mode"></param> /// <param name="compression"></param> public virtual void Open(Stream stream, DataFileMode fileMode) { EnsureNotOpen(); this.baseStream = stream; this.ownsBaseStream = false; this.fileMode = fileMode; }
protected DataFileBase(Stream stream, DataFileMode fileMode, CompressionMethod compression) { InitializeMembers(); this.baseStream = stream; this.fileMode = fileMode; this.compression = compression; }
/// <summary> /// Opens a file identified by a URI for read or write. /// </summary> /// <param name="uri"></param> /// <param name="mode"></param> /// <returns></returns> /// <remarks> /// If not set explicitly through properties, compression and archival settings /// are figured out automatically from the file extension. /// </remarks> public Stream Open(Uri uri, DataFileMode mode) { this.uri = uri; this.mode = mode; return Open(); }
public override void Open(Stream stream, DataFileMode fileMode) { base.Open(stream, fileMode); Open(); }