code: public static InputStream reWriteWaveHeader(InputStream is) throws IOException {
      byte[] audioBytes = toByteArray(is);
      int filesize = audioBytes.length - WAVE_HEADER_SIZE;
  
      writeInt(filesize, audioBytes, WAVE_SIZE_POS);
      writeInt(filesize - WAVE_HEADER_SIZE, audioBytes, WAVE_METADATA_POS);
  
      return new ByteArrayInputStream(audioBytes);
    }
docs: Re-writes the data size in the header(bytes 4-8) of the WAVE(.wav) input stream.<br>
  It needs to be read in order to calculate the size.
  
  @param is the input stream
  @return A new input stream that includes the data header in the header
  @throws IOException Signals that an I/O exception has occurred.