public static ReplicationControlAdminRequest readFrom(DataInputStream stream, AdminRequest adminRequest)
      throws IOException {
    Short versionId = stream.readShort();
    if (!versionId.equals(VERSION_V1)) {
      throw new IllegalStateException("Unrecognized version for ReplicationControlAdminRequest: " + versionId);
    }
    int listSize = stream.readInt();
    List<String> origins = new ArrayList<>();
    for (int i = 0; i < listSize; i++) {
      origins.add(Utils.readIntString(stream, StandardCharsets.UTF_8));
    }
    boolean enable = stream.readByte() == 1;
    return new ReplicationControlAdminRequest(origins, enable, adminRequest);
  }
Reads from a stream and constructs a {@link ReplicationControlAdminRequest}.
@param stream the stream to read from
@param adminRequest the {@link AdminRequest} that contains some necessary headers.
@return the {@link ReplicationControlAdminRequest} constructed from the {@code stream}.
@throws IOException if there is any problem reading from the stream
ambry-protocol/src/main/java/com/github/ambry/protocol/ReplicationControlAdminRequest.java