public static UndeleteResponse readFrom(DataInputStream stream) throws IOException {
    RequestOrResponseType type = RequestOrResponseType.values()[stream.readShort()];
    if (type != RequestOrResponseType.UndeleteResponse) {
      throw new IllegalArgumentException("The type of request response is not compatible");
    }
    Short versionId = stream.readShort();
    if (versionId != UNDELETE_RESPONSE_VERSION_1) {
      throw new IllegalArgumentException("Unknown version from stream " + versionId);
    }
    int correlationId = stream.readInt();
    String clientId = Utils.readIntString(stream);
    ServerErrorCode error = ServerErrorCode.values()[stream.readShort()];
    short lifeVersion = stream.readShort();
    return new UndeleteResponse(correlationId, clientId, lifeVersion, error);
  }
Constructs a {@link UndeleteResponse} with a valid lifeVersion. The error code will be set to {@link ServerErrorCode#NoError}.
@param correlationId correlationId of the undelete response.
@param clientId clientId of the undelete response.
@param lifeVersion a valid lifeVersion to return to client.
@param error error code returned in this undelete response.
ambry-protocol/src/main/java/com/github/ambry/protocol/UndeleteResponse.java