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. Andreas
