code: private boolean  expandCompositCharAtEnd(char[] dest,int start, int length,
                            int lacount){
        boolean spaceNotFound = false;
  
        if (lacount > countSpacesLeft(dest, start, length)) {
            spaceNotFound = true;
            return spaceNotFound;
        }
        for (int r = start + lacount, w = start, e = start + length; r < e; ++r) {
            char ch = dest[r];
            if (isNormalizedLamAlefChar(ch)) {
                dest[w++] = convertNormalizedLamAlef[ch - '\u065C'];
                dest[w++] = LAM_CHAR;
            } else {
                dest[w++] = ch;
            }
        }
        return spaceNotFound;
    }
docs: /*
  Name     : expandCompositCharAtEnd
  Function : Expands the LamAlef character to Lam and Alef consuming the
  required space from end of the buffer. If the text type was
  Visual LTR and the option SPACES_RELATIVE_TO_TEXT_BEGIN_END
  was used, the spaces will be consumed from begin of buffer. If
  there are no spaces to expand the LamAlef, an exception is thrown.