Gets or sets a boolean value indicating whether the output stream can be closed by the object.
Syntax
'Declaration
Public Property AllowOutputStreamClosure As Boolean
'Usage
Dim instance As ZipWriter
Dim value As Boolean
instance.AllowOutputStreamClosure = value
value = instance.AllowOutputStreamClosure
public bool AllowOutputStreamClosure {get; set;}
Property Value
true if the output stream can be closed by the object;
false otherwise. By default,
false.
Example
When the property is set to true, it allows for cleanup of both ZipWriter and the output stream in one 'using' statement (Example 1).
When the property is set to false, it is your responsibility to close the output stream once ZipWriter is done with it (Example 2).
using( ZipWriter writer = new ZipWriter( new SomeOutputStream(), false, true ) )
{
// Use 'writer'
}
Using writer As New ZipWriter(New SomeOutputStream(), False, True)
' Use 'writer'
End Using
using( Stream outputStream = new SomeOutputStream() )
{
using( ZipWriter writer = new ZipWriter( outputStream, false, false ) )
{
// Use 'writer'
}
}
Using outputStream As Stream = New SomeOutputStream()
Using writer As New ZipWriter(outputStream, False, False)
' Use 'writer'
End Using
End Using
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also