protected Object read(Class<?> cls) {
readFully(state.getLengthReadBuffer());
readFully(state.getPacketReadBuffer());
state.unpack(cls);
IntegerValue code = (IntegerValue) state.getHeader().get(Key.CODE);
if (code.getInt() != 0) {
RawValue error = (RawValue) state.getBody().get(Key.ERROR);
throw new TarantoolException(code.getInt(), error.getString());
}
return state.getBody().get(Key.DATA);
}