@Override
    public int[] getGlyphCodes(int beginGlyphIndex, int numEntries,
            int[] codeReturn) {

        if ((beginGlyphIndex < 0) || ((numEntries + beginGlyphIndex) > this.getNumGlyphs())) {
            // awt.44=beginGlyphIndex is out of vector's range
            throw new IndexOutOfBoundsException(Messages.getString("awt.44")); //$NON-NLS-1$
        }

        if (numEntries < 0) {
            // awt.45=numEntries is out of vector's range
            throw new IllegalArgumentException(Messages.getString("awt.45")); //$NON-NLS-1$
        }

        if (codeReturn == null) {
            codeReturn = new int[numEntries];
        }

        for (int i = beginGlyphIndex; i < beginGlyphIndex + numEntries; i++) {
            codeReturn[i-beginGlyphIndex] = this.vector[i].getGlyphCode();
        }

        return codeReturn;
    }