public void setEncodings(int nEncodings, int[] encodings)
  {
    if (nEncodings > nEncodings_) {
      encodings_ = new int[nEncodings];
    }
    nEncodings_ = nEncodings;
    useCopyRect = false;
    supportsLocalCursor = false;
    supportsDesktopResize = false;
    currentEncoding_ = Encodings.raw;

    for (int i = nEncodings-1; i >= 0; i--) {
      encodings_[i] = encodings[i];
      if (encodings[i] == Encodings.copyRect)
        useCopyRect = true;
      else if (encodings[i] == Encodings.pseudoEncodingCursor)
        supportsLocalCursor = true;
      else if (encodings[i] == Encodings.pseudoEncodingDesktopSize)
        supportsDesktopResize = true;
      else if (encodings[i] <= Encodings.max &&
               Encoder.supported(encodings[i]))
        currentEncoding_ = encodings[i];
    }
  }