@@ -39,7 +39,7 @@ private static void ThrowIfInvalid(FileAccess access)
39
39
private static void ThrowIfLeaveOpen ( StorageModeFlags flags )
40
40
{
41
41
if ( flags . HasFlag ( StorageModeFlags . LeaveOpen ) )
42
- throw new ArgumentException ( $ "{ StorageModeFlags . LeaveOpen } isnot valid forfiles ") ;
42
+ throw new ArgumentException ( $ "{ StorageModeFlags . LeaveOpen } isonly valid forinjected streams. ") ;
43
43
}
44
44
45
45
private static IOContextFlags ToIOContextFlags ( StorageModeFlags flags )
@@ -78,7 +78,12 @@ public static RootStorage Create(Stream stream, Version version = Version.V3, St
78
78
return new RootStorage ( rootContextSite , flags ) ;
79
79
}
80
80
81
- public static RootStorage CreateInMemory ( Version version = Version . V3 , StorageModeFlags flags = StorageModeFlags . None ) => Create ( new MemoryStream ( ) , version , flags ) ;
81
+ public static RootStorage CreateInMemory ( Version version = Version . V3 , StorageModeFlags flags = StorageModeFlags . None )
82
+ {
83
+ ThrowIfLeaveOpen ( flags ) ;
84
+
85
+ return Create ( new MemoryStream ( ) , version , flags ) ;
86
+ }
82
87
83
88
public static RootStorage Open ( string fileName , FileMode mode , StorageModeFlags flags = StorageModeFlags . None )
84
89
{