public ShortBuffer generateIndexBuffer() throws DataFormatException {

        ShortBuffer sb = null;
        ArrayList<Integer> index = new ArrayList<Integer>();
        short[] array;

        for (MQOFace face : faces) {
            if (3 == face.getIndex().size()) {
                for (Integer i : face.getIndex())
                index.add(i.intValue());
            }
            else {
                throw new DataFormatException("except triangle polygon is not supported yet");
            }
        }

        if (index.size() > 0) {
            sb = ByteBuffer.allocateDirect(index.size() * BYTES_PER_SHORT).order(ByteOrder.nativeOrder()).asShortBuffer();
            array = convertIndexArrayListToPrimitiveList(index);
            if (null != array) {
                sb.put(array);
            }
            sb.position(0);
        }

        return sb;
    }