Link to home
Start Free TrialLog in
Avatar of mamruoc
mamruoc

asked on

Need a FIFO in Java

Hi!

I've a audio stream whichI get via udp....

When the stream arrives as packet in 400 bytes, I need a FIFO where I can put more into it in the same time as I can playback it... Anybody got  a solution for that???
Avatar of girionis
girionis
Flag of Greece image

Use two threads. One to play the audio and the other to store it in an ArrayList or another collection object.
use one of the list implementation... putting more on the same or playback, you have to implement on your own.
There is no built in support of that in Java as I know
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mamruoc
mamruoc

ASKER

Thanks again...

Maybe you should be the person how's doing this Java application.. :D
8-)
Avatar of mamruoc

ASKER

Hi!!

Hope you're still there...

Can your FIFO store binary data?

Seems like it don't play back that well... But if I send a file with content:

\x0A, it seems to store and playback well....

regards
>>Can your FIFO store binary data?

Yes, as you can see, i assumed using a byte[]. Playback is another thing of course ...
Avatar of mamruoc

ASKER

Well,,

I just dropped using ArrayList and used Vector, seems like Vetor is more efficient....