struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Newfield <d...@newfield.org>
Subject Re: [S2] Can't setBufferSize on StreamResult from action configuration (Struts2 2.1.6)
Date Sat, 04 Jul 2009 15:36:19 GMT
Francisco José Aquino García wrote:
> 2009/7/1 Dale Newfield <dale@newfield.org>:
>> May I ask why you need to dynamically change the buffer size?
> 
> to use the filesystem block size where the thumbnail resides as the
> bufferSize, as different thumbnails may reside in different
> filesystems

That sounds like a reasonable motivation.  Unfortunately as we've 
previously discussed, the current stream result object won't support 
dynamic values for this.  An evil workaround could be to configure a 
bunch of nearly identical results "success-stream-512", 
"success-stream-1024", "success-stream-8192", etc. and dispatch to the 
appropriate one.  A better solution would be to modify the stream 
result.  Patches are welcome to change that, and if you're quick (and if 
you smile sweetly at Musachy) you might be able to get that change into 
2.1.8...

> That's it. I didn't think very much about it really, I'm not an expert
> in Java IO so maybe this makes not much sense (the same goes for using
> BufferedInputStream instead of just the default InputStream.)

BufferedInputStream adds much more complexity and probably isn't 
necessary, but as long as it works...

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message