Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting SAXException while using document.parse(string)
    primarykey
    data
    text
    <p>I want to reuse the Inputstream coming from HTTP response.resultset()...</p> <ul> <li>I converted inputstream to byte[] array (also need to store so I create byte array.)</li> <li>Than convert into string</li> <li>when i pass it to document.parse(string) gave error saxparserException:---eof not found</li> <li><strong>working fine with document.parse(stream)</strong>.</li> </ul> <p>//------------Following methods are not helpfull for me ,each of them leads to<br> saxparserException protocl not found .</p> <pre><code>import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.IOException; public static String readInputStreamAsString(InputStream in) throws IOException { BufferedInputStream bis = new BufferedInputStream(in); ByteArrayOutputStream buf = new ByteArrayOutputStream(); int result = bis.read(); while(result != -1) { byte b = (byte)result; buf.write(b); result = bis.read(); } return buf.toString(); } //-------------- byte[] bytes=new byte[inputStream.available()]; inputStream.read(bytes); String s = new String(bytes); //------------------ StringBuilder response = new StringBuilder(); int value = 0; boolean active = true; while (active) { value = is.read(); if (value == -1) { throw new IOException("End of Stream"); } else if (value != '\n') { response.append((char) value); continue; } else { active = false; } } return response.toString(); //-------------- BufferedInputStream ib = new BufferedInputStream(is,1024*1024); StringBuffer sb = new StringBuffer(); String temp = ib.readLine(); while (temp !=null){ sb.append (temp); sb.append ("\n"); temp = ib.readLine(); } s = sb.toString() </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload