# CSJ2K.j2k.util.ArrayUtil.byteArraySet

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="CSJ2K_j2k_util_ArrayUtil_byteArraySet_" data-uid="CSJ2K.j2k.util.ArrayUtil.byteArraySet*">byteArraySet Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="CSJ2K_j2k_util_ArrayUtil_byteArraySet_" data-uid="CSJ2K.j2k.util.ArrayUtil.byteArraySet*"></a>
<h4 id="CSJ2K_j2k_util_ArrayUtil_byteArraySet_System_Byte___System_Byte_" data-uid="CSJ2K.j2k.util.ArrayUtil.byteArraySet(System.Byte[],System.Byte)">byteArraySet(byte[], byte)</h4>
<div class="markdown level1 summary"><p>Reinitializes a byte array to the given value in an optimized way. If
the length of the array is less than MAX_EL_COPYING, then the array
is set element by element in the normal way, otherwise the first
INIT_EL_COPYING elements are set element by element and then
System.arraycopy is used to set the other parts of the array.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void byteArraySet(byte[] arr, byte val)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Sub byteArraySet(arr As Byte(), val As Byte)</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.byte">byte</a>[]</td>
      <td><span class="parametername">arr</span></td>
      <td><p>The array to set.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a></td>
      <td><span class="parametername">val</span></td>
      <td><p>The value to set the array to.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
