code: public double[] getInterleavedSamples(long begin, long end, double[] samples)
              throws IOException, IllegalArgumentException {
          long nbSamples = end - begin;
          long nbBytes = nbSamples * (getFormat().getSampleSizeInBits() / 8)
                  * getFormat().getChannels();
          if (nbBytes > Integer.MAX_VALUE) {
              throw new IllegalArgumentException(
                      "Too many samples. Try using a smaller wav.");
          }
          // allocate a byte buffer
          byte[] inBuffer = new byte[(int) nbBytes];
          // read bytes from audio file
          _audioInputStream.read(inBuffer, 0, inBuffer.length);
          // decode bytes into samples.
          decodeBytes(inBuffer, samples);
  
          return samples;
      }
docs: Get the interleaved decoded samples for all channels, from sample index
  <code>begin</code> (included) to sample index <code>end</code> (excluded)
  and copy them into <code>samples</code>. <code>end</code> must not exceed
  <code>getSampleCount()</code>, and the number of samples must not be so
  large that the associated byte array cannot be allocated
  
  @param begin begin
  @param end end
  @param samples samples
  @throws java.io.IOException java.io.IOException
  @throws java.lang.IllegalArgumentException java.lang.IllegalArgumentException
  @return samples bytes