peshkira/4Store-API — Issue #1: Fix Response ErrorCheck 
Author: peshkira
Created: 2012-01-27 11:02:29+00:00
State: open

Fix the checkResultsForError method in https://github.com/peshkira/4Store-API/blob/master/src/com/clarkparsia/fourstore/impl/StoreImpl.java as it is very unefficient in its current implementation, since it loads the whole response from the input stream into memory and then makes a new input stream again.

A possible solution:
Mark the beginning of the input stream. Read the first 100 bytes or so and then if no error is found ("parse Error or stuff"), just use the reset() method of the input stream to fix the pointer and then continue the further processing normally.
For this to be robust all kind of error responses should be checked. Is there a 4store specification for this?