decodeError();
} else {
this.countDownLatch();
}
} else {
CachedData value = this.returnValues.values().iterator().next();
// If disable save primitive type as string,the response data have
// 4-bytes flag aheader.
if (!this.transcoder.isPrimitiveAsString()) {
byte[] data = value.getData();
if (data.length >= 4) {
byte[] flagBytes = new byte[4];
System.arraycopy(data, 0, flagBytes, 0, 4);
byte[] realData = new byte[data.length - 4];
System.arraycopy(data, 4, realData, 0, data.length - 4);
int flag = transcoderUtils.decodeInt(flagBytes);
value.setFlag(flag);
value.setData(realData);
value.setCapacity(realData.length);
}
}
setResult(value);
this.countDownLatch();
}