gatein/gatein-wcm — pull request #17 by ppalaga (2013-05-10 09:49:16+00:00)
Title: GTNWCM-25 Add getReader to WCMTextDocument and make WCMTextDocument

extend WCMBinaryDocument

This proposal makes it possible to avoid using potentially memory-expensive String getContent() of WCMTextDocument. The API user can choose to use getContentAsReader() with smaller memory footprint.

WCMTextDocument was made a subclass of WCMBinaryDocument so that all binary doc functionality is available also in WCMTextDocument.

WCMBinaryDocument size attribute was made read-only. The size is get/set automatically based on the length of the underlying InputStream.

WCMBinaryDocument encoding attribute was added to make bin -> text transformations possible. ATM, it is set internally to default UTF-8 encoding. I find myself this part of the implementation as further improvable. I'd do that if this proposal is accepted as a whole.