private static byte[] readStream(AudioInputStream stream)
			throws IOException {
		byte[] data = new byte[stream.available()];
		int bytesRead = 0;
		int totalBytesRead = 0;
		while ((bytesRead = stream.read(data, totalBytesRead, data.length
				- totalBytesRead)) != -1
				&& totalBytesRead < data.length) {
			totalBytesRead += bytesRead;
		}
		return data;
	}