java.lang.Object | ||||
↳ | java.io.InputStream | |||
↳ | java.io.ByteArrayInputStream | |||
↳ | sun.audio.AudioDataStream | |||
↳ | sun.audio.ContinuousAudioDataStream |
Create a continuous audio stream. This wraps a stream around an AudioData object, the stream is restarted at the beginning everytime the end is reached, thus creating continuous sound.
For example:
AudioData data = AudioData.getAudioData(url); ContinuousAudioDataStream audiostream = new ContinuousAudioDataStream(data); AudioPlayer.player.start(audiostream);
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a continuous stream of audio.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Reads the next byte of data from this input stream.
| |||||||||||
Reads up to
len bytes of data into an array of bytes
from this input stream. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Reads the next byte of data from this input stream. The value
byte is returned as an int
in the range
0
to 255
. If no byte is available
because the end of the stream has been reached, the value
-1
is returned.
This read
method
cannot block.
-1
if the end of the
stream has been reached.
Reads up to len
bytes of data into an array of bytes
from this input stream.
If pos
equals count
,
then -1
is returned to indicate
end of file. Otherwise, the number k
of bytes read is equal to the smaller of
len
and count-pos
.
If k
is positive, then bytes
buf[pos]
through buf[pos+k-1]
are copied into b[off]
through
b[off+k-1]
in the manner performed
by System.arraycopy
. The
value k
is added into pos
and k
is returned.
This read
method cannot block.
ab | the buffer into which the data is read. |
---|---|
i1 | the start offset in the destination array b |
j | the maximum number of bytes read. |
-1
if there is no more data because the end of
the stream has been reached.