コード例 #1
0
 /// <summary>
 /// Opens the stream with specified mode, access, and sharing mode.
 /// </summary>
 /// <param name="mode">Mode to open this stream with.</param>
 /// <param name="access">Access mode for the opened stream.</param>
 /// <param name="share">Sharing mode for the stream.</param>
 /// <returns><see cref="FileStream"/> instance to use for IO operations.</returns>
 public FileStream Open(FileMode mode, FileAccess access, FileShare share)
 => InteropWrapper.Open(this, mode, access, share);
コード例 #2
0
 /// <summary>
 /// Creates a new alternate data stream within specified file. If a stream with this name exists, an exception is thrown.
 /// </summary>
 /// <param name="file">File to create the data stream for.</param>
 /// <param name="name">Name of the data stream to create.</param>
 /// <returns><see cref="FileStream"/> instance for IO operations.</returns>
 public static FileStream CreateDataStream(this FileInfo file, string name)
 => InteropWrapper.Open(new FileDataStream(file, name, 0, FileDataStreamType.Data), FileMode.CreateNew, FileAccess.Write, FileShare.None);