jersey-streaming icon indicating copy to clipboard operation
jersey-streaming copied to clipboard

Question about streaming

Open dessalines opened this issue 11 years ago • 1 comments

I've found that when using this, for some reason, the initial streaming was taking really long(15-30 seconds), even after the first byte partial was returned.

Then after the initial loading was done, seeking around to different parts of the stream was instant.

I then tried viewing this in a browser, and it didn't seem to load parts of the file, until the file was all done. Then once scrolling around, it streamed correctly.

Is there a header I'm missing or something?

dessalines avatar Jun 27 '15 18:06 dessalines

I don't know what I did to fix this, but here it was:

                final RandomAccessFile raf = new RandomAccessFile(mp3, "r");
                raf.seek(fromTo[0]);
                writeAudioToOS(length, raf, stream);
                raf.close();

                stream.flush();
                stream.close();

dessalines avatar Jun 27 '15 23:06 dessalines