numRecords = nameTable.getChar(); offset = nameTable.getChar();
numRecords = nameTable.getShort(); offset = nameTable.getShort();
  public static String getName(ByteBuffer nameTable,                               int name, Locale locale)  {    int numRecords;    int macLanguage, msLanguage;    int offset;    int namePlatform, nameEncoding, nameLanguage, nameID, nameLen;    int nameStart;    String result;    boolean match;    if (nameTable == null)      return null;    nameTable.position(0);    /* We understand only format 0 of the name table. */    if (nameTable.getChar() != 0)      return null;    macLanguage = getMacLanguageCode(locale);    msLanguage = getMicrosoftLanguageCode(locale);    numRecords = nameTable.getChar();    offset = nameTable.getChar();    for (int i = 0; i < numRecords; i++)    {      namePlatform = nameTable.getChar();      nameEncoding = nameTable.getChar();      nameLanguage = nameTable.getChar();      nameID = nameTable.getChar();      nameLen = nameTable.getChar();      nameStart = offset + nameTable.getChar();            if (nameID != name)        continue;      match = false;      switch (namePlatform)      {      case PLATFORM_MACINTOSH:        if ((nameLanguage == macLanguage) || (locale == null))          match = true;        else        {          switch (macLanguage)          {          case 49: /* Azerbaijani/Cyrillic */            match = (nameLanguage == /* Azerbaijani/Arabic */ 50)              || (nameLanguage == /* Azerbaijani/Roman */ 150);            break;          case 57: /* Mongolian/Mongolian */            match = (nameLanguage == /* Mongolian/Cyrillic */ 58);            break;          case 83: /* Malay/Roman */            match = (nameLanguage == /* Malay/Arabic */ 84);            break;          }        }        break;      case PLATFORM_MICROSOFT:        if (((nameLanguage & 0xff) == msLanguage) || (locale == null))          match = true;        break;      }            if (match)      {        result = decodeName(namePlatform, nameEncoding, nameLanguage,                            nameTable, nameStart, nameLen);        if (result != null)          return result;      }    }    return null;  }