public static String encodingName(int num) {
    switch (num) {
    case encodingRaw:           return "Raw";
    case encodingCopyRect:      return "CopyRect";
    case encodingRRE:           return "RRE";
    case encodingCoRRE:         return "CoRRE";
    case encodingHextile:       return "Hextile";
    case encodingTight:         return "Tight";
    case encodingZRLE:          return "ZRLE";
    default:                    return "[unknown encoding]";
    }
  }