checkHeaders();
if (backOff == 0 && //if we got a 503,500 or 204 back off will not be 0
//if status isn't a 204 and we're not backing off then we're in an invalid state if the rest holds true
status != 204 &&
headersSet && (format == null || format.isEmpty())) {
throw new IllegalDataSiftPullFormat("The DataSift API failed to provide the format of the data. " +
"Please raise the issue with support", response);
}
if (format != null) {
switch (format) {
case FORMAT_NEW_LINE:
if (done) {
//chunked responses will cause new line to break
// early so only do it when he entire response is received
readLineByLine();
}
break;
case FORMAT_ARRAY:
readArray();
break;
case FORMAT_META:
readObject();
break;
default:
throw new IllegalDataSiftPullFormat("DataSift format '" + format + "' is not supported", response);
}
}
}