code: private static void readSound(AudioInputStream input, SourceDataLine dataLine) throws IOException
      {
          int read;
          final byte[] buffer = new byte[BUFFER];
          while ((read = input.read(buffer, 0, buffer.length)) > 0)
          {
              dataLine.write(buffer, 0, read);
          }
      }
docs: Read the full sound and play it by buffer.
  
  @param input The audio input.
  @param dataLine Audio source data.
  @throws IOException If error when reading the sound.