Hi Andreas, On Mon, Nov 10, 2008 at 12:49 AM, Andreas Veithen <[EMAIL PROTECTED] > wrote:
> On Sun, Nov 9, 2008 at 19:52, Senaka Fernando <[EMAIL PROTECTED]> wrote: > >> * In WrappedTextNodeStreamReader, the character data is returned in > >> chunks in order to avoid loading the entire data into memory > >> (typically the data comes from a temporary file). I don't think that > >> this is necessary for the map values, and could even introduce > >> unnecessary overhead. They should simply be converted to a String and > >> returned as a single chunk. Getting rid of the java.io.Reader would > >> also simplify the code. > > > > > > Sounds logical. But, what made me go for this approach is that I assumed > > that at times a typical Map MIGHT have data that is too large to fit in > > memory. WDYT? > > The only types for which this question is relevant are strings and > byte arrays (all other types have a limited size anyway). When you > retrieve the value for such an entry, JMS will return it as a String > or byte[] object which implies that it is already loaded into memory > in its entirety. Note that for strings, the code in > StAXBuilder#createOMText(OMContainer, int) shows that AXIOM will call > XMLStreamReader#getText() so that you can directly return the String > object retrieved from JMS. Yes, I was typically referring to Strings. However, the requirement for the MapBackedOM at Axiom level isn't only for JMS Map Messages IMHO. Anyway, as you explain, since Axiom anyway reads the String in full, it might not be worth to adopt the present approach. Thanks for the clarification. Will have this sorted as well. Regards, Senaka > > > Andreas >
