so i have the following code opening an input stream and collecting the information successfully:
httpInput = httpConnection.openInputStream();
sb= new StringBuffer();
while (ch != -1)
{
ch = httpInput.read();
sb.append((char)ch);
}
however, when i try to use that same string (sb.toString()) in another method, i get an error stating "Expecting end of file.". so how do i attach an EOF character to my string? NOTE: the response is basically an xml document coming from a remote server.
so when the code reaches the "parse" line, it gives me the error above:
bis = new ByteArrayInputStream(sb.toString().getBytes()); doc = docBuilder.parse(bis);
i am coding this for a blackberry application.
ac