Q:

Playing an Integer/Double Array in Java

I'm trying to play an array in a Java program. 
So far I was able to play byte arrays with the following code: 
AudioFormat audioFormat = new AudioFormat(samplingFreq, bps, 1, true, true);
SourceDataLine sdline = AudioSystem.getSourceDataLine(audioFormat);
line.open(audioFormat);
sdline.start();        
sdline.write(playArray, 0, playArray.length);
sdline.drain();
sdline.close();

However, with this I'm only able to play byte arrays since the write method only accepts byte arrays as argument. I want to be able to play 16/32 bits per sample arrays as well. 
Are there any ways to play integer arrays or even doubles using AudioSystem(or any other class).

A:

With the help of the comment from @greg-449, I was able to solve the problem. To play higher bits per second, you just need to increase the bps argument and send bytes one after another.
As an example, if we want to send 1867 as a sample, we need 16 bits which are as follows :
0000 0111 0100 1011
The first 8 bits are 7 in decimal and the second eight bits are 75 in decimal, so since we're using big endian(last argument of the AudioFormat argument), the first element of our byte array should be 7 and the second element should be 75. So for 16 bits, we just need two bytes for each sample.   

