public static RequestControlAdminRequest readFrom(DataInputStream stream, AdminRequest adminRequest)
      throws IOException {
    Short versionId = stream.readShort();
    if (!versionId.equals(VERSION_V1)) {
      throw new IllegalStateException("Unrecognized version for RequestControlAdminRequest: " + versionId);
    }
    RequestOrResponseType requestType = RequestOrResponseType.values()[stream.readShort()];
    boolean enable = stream.readByte() == 1;
    return new RequestControlAdminRequest(requestType, enable, adminRequest);
  }
Reads from a stream and constructs a {@link RequestControlAdminRequest}.
@param stream the stream to read from
@param adminRequest the {@link AdminRequest} that contains some necessary headers.
@return the {@link RequestControlAdminRequest} constructed from the {@code stream}.
@throws IOException
ambry-protocol/src/main/java/com/github/ambry/protocol/RequestControlAdminRequest.java