public static AdminResponse readFrom(DataInputStream stream) throws IOException {
    RequestOrResponseType type = RequestOrResponseType.values()[stream.readShort()];
    if (type != RequestOrResponseType.AdminResponse) {
      throw new IllegalArgumentException("The type of request response is not compatible (is " + type + ")");
    }
    Short versionId = stream.readShort();
    if (!versionId.equals(ADMIN_RESPONSE_VERSION_V1)) {
      throw new IllegalStateException("Unrecognized version for AdminResponse: " + versionId);
    }
    int correlationId = stream.readInt();
    String clientId = Utils.readIntString(stream);
    ServerErrorCode error = ServerErrorCode.values()[stream.readShort()];
    // ignore version for now
    return new AdminResponse(correlationId, clientId, error);
  }
Reads from a stream and constructs an {@link AdminResponse}.
@param stream  the {@link DataInputStream} to read from.
@return {@link AdminResponse} that is deserialized from the {@code stream}.
@throws IOException if there is an I/O error reading from {@code stream}
ambry-protocol/src/main/java/com/github/ambry/protocol/AdminResponse.java