Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Work with multiple filestreams or load data first in string buffers?

807588Mar 16 2009 — edited Mar 17 2009
Hey there.

I need to read a little bit of binary data from jpg 1, then a bit from jpg 2, then jpg 3 and so on. I then need to go back and read the next bit of data from jpg 1, then jpg 2 etc...

My question is, would it be better to set up multiple filestreams which I could access from an object array (I'm presuming this can be done), or would it be better to read the entire binary data from jpg 1 to a stringbuffer in an array, then the entire binary data for jpg 2 etc and then when all the files are loaded, go back and manipulate the data in the array.

It seems to me the multiple filestream way is the simpler, but I could have anything between 5 to 20, possibly up to 50 or even more filestreams open at the same time and I was wondering whether that might not be a problem...

I'd be grateful to any advice as to the possible pros and cons to each method, and which way would be recommended.

Thanks a lot!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 14 2009
Added on Mar 16 2009
6 comments
156 views