Visual Basic (Declaration) | |
---|---|
Public Function New( _ ByVal filename As String, _ ByVal mode As FileMode, _ ByVal access As FileAccess, _ ByVal share As FileShare, _ ByVal bufferSize As Integer, _ ByVal options As FileOptions _ ) |
C# | |
---|---|
public FileStreamFactory( string filename, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options ) |
Parameters
- filename
- mode
- access
- share
- bufferSize
- options
Library/Library.Test/TestStreamCache.cs
C# | Copy Code |
---|---|
using(TempFile tempFile = new TempFile()) { FileStreamFactory factory = new FileStreamFactory(tempFile.TempPath, FileMode.Create, FileAccess.ReadWrite, FileShare.None, 1024, FileOptions.Asynchronous); Assert.AreEqual(tempFile.TempPath, factory.FileName); using (FileStream s = (FileStream)factory.Create()) Assert.IsTrue(s.CanRead && s.CanWrite && s.IsAsync); } |
VB.NET | Copy Code |
---|---|
Using tempFile As New TempFile() Dim factory As New FileStreamFactory(tempFile.TempPath, FileMode.Create, FileAccess.ReadWrite, FileShare.None, 1024, FileOptions.Asynchronous) Assert.AreEqual(tempFile.TempPath, factory.FileName) Using s As FileStream = DirectCast(factory.Create(), FileStream) Assert.IsTrue(s.CanRead AndAlso s.CanWrite AndAlso s.IsAsync) End Using End Using |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
FileStreamFactory ClassFileStreamFactory Members
Overload List