Hi, I am trying to read from an inputSource and stored the read characters into a stringbuffer. This is causing the outOfMemory beyond certain sized datasource (data that I am returning in the form of XML from Oracle). I read somewhere that I can buffer the read and thus overcome this problem. However, I am not sure how to implement it codewise. Here is my code (works great for files upto 0.5MB): int c; InputStream in=clobXML.getAsciiStream(); while ((c = in.read()) != -1) {sb.append((char) c);} Can someone please help me as to how to modify this code? Thanks
Not sure if this will help, but are you talking about using a BufferedInputStream? If so, construct it like so: BufferedInputStream buffer = new BufferedInputStream( clobXML.getAsciiStream() ); Then you can read like normal.