# C1.Zip.C1ZStreamWriter.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Zip_C1ZStreamWriter__ctor_" data-uid="C1.Zip.C1ZStreamWriter.#ctor*">C1ZStreamWriter Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Zip_C1ZStreamWriter__ctor_" data-uid="C1.Zip.C1ZStreamWriter.#ctor*"></a>
<h4 id="C1_Zip_C1ZStreamWriter__ctor_System_IO_Stream_" data-uid="C1.Zip.C1ZStreamWriter.#ctor(System.IO.Stream)">C1ZStreamWriter(Stream)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Zip.C1ZStreamWriter.html">C1ZStreamWriter</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1ZStreamWriter(Stream baseStream)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(baseStream As Stream)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">baseStream</span></td>
      <td><p>Output stream that will contain the compressed data.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Zip_C1ZStreamWriter__ctor_" data-uid="C1.Zip.C1ZStreamWriter.#ctor*"></a>
<h4 id="C1_Zip_C1ZStreamWriter__ctor_System_IO_Stream_System_Boolean_" data-uid="C1.Zip.C1ZStreamWriter.#ctor(System.IO.Stream,System.Boolean)">C1ZStreamWriter(Stream, bool)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Zip.C1ZStreamWriter.html">C1ZStreamWriter</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1ZStreamWriter(Stream baseStream, bool zip)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(baseStream As Stream, zip As Boolean)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">baseStream</span></td>
      <td><p>Output stream that will contain the compressed data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">zip</span></td>
      <td><p>Specifies whether the compressed stream should be compatible with zip files.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Zip_C1ZStreamWriter__ctor_System_IO_Stream_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Streams in zip files are different from regular zlib streams in two aspects:</p>
<p>(1) zip streams do not contain any local header information (the information is stored in the zip file headers instead) and</p>
<p>(2) zip streams use a CRC32 checksum instead of the adler32 checksum used by zlib streams.</p>
</div>


<a id="C1_Zip_C1ZStreamWriter__ctor_" data-uid="C1.Zip.C1ZStreamWriter.#ctor*"></a>
<h4 id="C1_Zip_C1ZStreamWriter__ctor_System_IO_Stream_System_Boolean_System_Boolean_" data-uid="C1.Zip.C1ZStreamWriter.#ctor(System.IO.Stream,System.Boolean,System.Boolean)">C1ZStreamWriter(Stream, bool, bool)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Zip.C1ZStreamWriter.html">C1ZStreamWriter</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1ZStreamWriter(Stream baseStream, bool header, bool crc32)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(baseStream As Stream, header As Boolean, crc32 As Boolean)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">baseStream</span></td>
      <td><p>Output stream that will contain the compressed data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">header</span></td>
      <td><p>Include header information in compressed stream (should be False for streams in zip files).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">crc32</span></td>
      <td><p>Include CRC32 checksum in compressed stream (should be True for streams in zip files).</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Zip_C1ZStreamWriter__ctor_" data-uid="C1.Zip.C1ZStreamWriter.#ctor*"></a>
<h4 id="C1_Zip_C1ZStreamWriter__ctor_System_IO_Stream_C1_Zip_CompressionLevelEnum_" data-uid="C1.Zip.C1ZStreamWriter.#ctor(System.IO.Stream,C1.Zip.CompressionLevelEnum)">C1ZStreamWriter(Stream, CompressionLevelEnum)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Zip.C1ZStreamWriter.html">C1ZStreamWriter</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1ZStreamWriter(Stream baseStream, CompressionLevelEnum level)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(baseStream As Stream, level As CompressionLevelEnum)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">baseStream</span></td>
      <td><p>Output stream that will contain the compressed data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Zip.CompressionLevelEnum.html">CompressionLevelEnum</a></td>
      <td><span class="parametername">level</span></td>
      <td><p>Compression level to use when compressing data.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Zip_C1ZStreamWriter__ctor_" data-uid="C1.Zip.C1ZStreamWriter.#ctor*"></a>
<h4 id="C1_Zip_C1ZStreamWriter__ctor_System_IO_Stream_C1_Zip_CompressionLevelEnum_System_Boolean_" data-uid="C1.Zip.C1ZStreamWriter.#ctor(System.IO.Stream,C1.Zip.CompressionLevelEnum,System.Boolean)">C1ZStreamWriter(Stream, CompressionLevelEnum, bool)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Zip.C1ZStreamWriter.html">C1ZStreamWriter</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1ZStreamWriter(Stream baseStream, CompressionLevelEnum level, bool zip)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(baseStream As Stream, level As CompressionLevelEnum, zip As Boolean)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">baseStream</span></td>
      <td><p>Output stream that will contain the compressed data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Zip.CompressionLevelEnum.html">CompressionLevelEnum</a></td>
      <td><span class="parametername">level</span></td>
      <td><p>Compression level to use when compressing data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">zip</span></td>
      <td><p>Specifies whether the compressed stream should be compatible with zip files.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Zip_C1ZStreamWriter__ctor_" data-uid="C1.Zip.C1ZStreamWriter.#ctor*"></a>
<h4 id="C1_Zip_C1ZStreamWriter__ctor_System_IO_Stream_C1_Zip_CompressionLevelEnum_System_Boolean_System_Boolean_" data-uid="C1.Zip.C1ZStreamWriter.#ctor(System.IO.Stream,C1.Zip.CompressionLevelEnum,System.Boolean,System.Boolean)">C1ZStreamWriter(Stream, CompressionLevelEnum, bool, bool)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Zip.C1ZStreamWriter.html">C1ZStreamWriter</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1ZStreamWriter(Stream baseStream, CompressionLevelEnum level, bool header, bool crc32)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(baseStream As Stream, level As CompressionLevelEnum, header As Boolean, crc32 As Boolean)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">baseStream</span></td>
      <td><p>Output stream that will contain the compressed data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Zip.CompressionLevelEnum.html">CompressionLevelEnum</a></td>
      <td><span class="parametername">level</span></td>
      <td><p>Compression level to use when compressing data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">header</span></td>
      <td><p>Include header information in compressed stream (should be False for streams in zip files).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">crc32</span></td>
      <td><p>Include CRC32 checksum in compressed stream (should be True for streams in zip files).</p>
</td>
    </tr>
  </tbody>
</table>
</div>
