If I open the URL and get input stream for file, then buffer size for file is 2kB and I need to change this size because of access to file. This concerns ftp, http, file,.... When I use read(new byte[size]) where size = 10kB then access to file will be 5... My problem is what happens is I use new BufferedInputSttream(..url stream.., 10kB). The access will be 1, speed slower because of 2 buffers.... ? I like to change URL buffer directly.
austy
> If I open the URL and get input stream for file, then
> buffer size for file is 2kB and I need to change this
> size because of access to file. This concerns ftp,
> http, file,.... When I use read(new byte[size]) where
> size = 10kB then access to file will be 5... My
> problem is what happens is I use new
> BufferedInputSttream(..url stream.., 10kB). The
> access will be 1, speed slower because of 2
> buffers.... ? I like to change URL buffer directly.
>
> austy
you mean you need the strategy for many types ?
file,ftp,http
different type with different buffer size ?
I think URL without buffer size,so you should use some Design Pattern
such as wrape the URL / BufferedInputSttream ,or something...
> If I open the URL and get input stream for file, then
> buffer size for file is 2kB and I need to change this
> size because of access to file. This concerns ftp,
> http, file,.... When I use read(new byte[size]) where
> size = 10kB then access to file will be 5... My
> problem is what happens is I use new
> BufferedInputSttream(..url stream.., 10kB). The
> access will be 1, speed slower because of 2
> buffers.... ? I like to change URL buffer directly.
>
This sounds like rubbish! Since you are going over a network you will almost certainly limited by network bandwidth and not by the number of buffer accesses you need. Stop trying to micro optimize your application until it is shown to be a problem.