code: public int getGroupLengths(int index, char offsets[], char lengths[])
      {
          char length = 0xffff;
          byte b = 0,
              n = 0;
          int shift;
          index = index * m_groupsize_; // byte count offsets of group strings
          int stringoffset = UCharacterUtility.toInt(
                                   m_groupinfo_[index + OFFSET_HIGH_OFFSET_],
                                   m_groupinfo_[index + OFFSET_LOW_OFFSET_]);
  
          offsets[0] = 0;
  
          // all 32 lengths must be read to get the offset of the first group
          // string
          for (int i = 0; i < LINES_PER_GROUP_; stringoffset ++) {
              b = m_groupstring_[stringoffset];
              shift = 4;
  
              while (shift >= 0) {
                  // getting nibble
                  n = (byte)((b >> shift) & 0x0F);
                  if (length == 0xffff && n > SINGLE_NIBBLE_MAX_) {
                      length = (char)((n - 12) << 4);
                  }
                  else {
                      if (length != 0xffff) {
                         lengths[i] = (char)((length | n) + 12);
                      }
                      else {
                         lengths[i] = (char)n;
                      }
  
                      if (i < LINES_PER_GROUP_) {
                         offsets[i + 1] = (char)(offsets[i] + lengths[i]);
                      }
  
                      length = 0xffff;
                      i ++;
                  }
  
                  shift -= 4;
              }
          }
          return stringoffset;
      }
docs: Reads a block of compressed lengths of 32 strings and expands them into
  offsets and lengths for each string. Lengths are stored with a
  variable-width encoding in consecutive nibbles:
  If a nibble<0xc, then it is the length itself (0 = empty string).
  If a nibble>=0xc, then it forms a length value with the following
  nibble.
  The offsets and lengths arrays must be at least 33 (one more) long
  because there is no check here at the end if the last nibble is still
  used.
  @param index of group string object in array
  @param offsets array to store the value of the string offsets
  @param lengths array to store the value of the string length
  @return next index of the data string immediately after the lengths
  in terms of byte address