Hi Robert, if your OutputStream is buffered, it will automatically flush the buffer when it is full. Simply set the buffer to some reasonable size for network use. The documentation refers to explicitly flushing the output stream when the input stream reaches EOF.
For example, with a 40k buffer (pretty big), you'll need 26000 clients before you have filled up 1GB of memory. Since you'll also be using up one thread per client, your server will probably crash and burn and die long before that. /LS On Tue, 13 Jul 2004 17:51:53 -0400, Robert Taylor <[EMAIL PROTECTED]> wrote: > Greetings, I would like to use CopyUtils.copy(InputStream is, OutpuStream os) to > manually > server (read from input stream and write to output stream) up large binary files to > web clients (browsers). > > After reading the documentation which indicates it does not flush the buffer in the > method, > I'm concerned that this would result in OutOfMemoryErrors under large loads. > > I was under the assumption that it would be prudent to flush the buffer after a > certain number > of reads to reduce the amount of resident memory used. > > Is there a another utility to perform such a common task? > > robert > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
