title: Insertion at specific place in file java
body: <p>I have a code have two byte arrays named array and buffer. First array insert data at the start of output file and second array then start from where first array end. I want to insert first array (array) at specific location of second array. How can I do</p>
  
  <pre><code>    byte[] array = null;
      outputStream.write(array);
  
      // Now
      byte[] buffer = new byte[1024];
      int len;
      while ((len = inputStream.read(buffer)) &gt; 0) {
          outputStream.write(book.update(buffer, 0, len));
          outputStream.flush();
      }
      outputStream.write(book.doFinal());
  </code></pre>