private void constructBTree() throws FileNotFoundException{
        try {
            int linesRead = 0;
            long postlenghtCounter = 0;
            BufferedReader br = new BufferedReader(new FileReader(IndexFileUtils.getInstance().getVocFileObject()));
            String line = br.readLine();
            while (line != null) {
                linesRead++;
                String[] termInfo = this.vocParser.parseLine(line);
                PostingInfo postingInfo = this.getPostingInfo(termInfo);
                // NUEVO
                // Codigo para crear un nuevo indice corto, sin singletons y doubletons
                if (postingInfo.getPostingLenght() >= POSTING_GENERIC_MIN && IndexFileUtils.getInstance().createShortPosting){
                    // Escribir informacion de la posting en el nuevo indice
                    // Obtner nuevo puntero y actualizarlo
                    long newPointer = IndexFileUtils.getInstance().getShortPostingFileObject().length();
                    this.writeShortIndex(IndexFileUtils.getInstance().getOsShortPostingFile(),postingInfo.getPostingData());
                    ((PostingInfoGeneric) postingInfo).setPostingPointer((int) newPointer);
                }
                this.updateBTree(termInfo,postingInfo);
                this.updateStats(termInfo);
                postlenghtCounter += Integer.parseInt(termInfo[1]);
                this.printStatus(linesRead);
                line = br.readLine();
            }
            //this.postingAverageLenght = (postlenghtCounter / this.vocterms);
            //System.out.println(postingAverageLenght);
            if (IndexFileUtils.getInstance().createShortPosting){
                try {
                    IndexFileUtils.getInstance().setPostingFileObject(IndexFileUtils.getInstance().getShortPostingFileObject());
                    IndexFileUtils.getInstance().getOsShortPostingFile().close();
                } catch (IOException ex) {
                    Logger.getLogger(VocManager.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
            this.printTreeKeys();
            //IndexFileUtils.getInstance().getIsPostingFileObject().close();
            br.close();
        } catch (IOException ex) {
            Logger.getLogger(VocManager.class.getName()).log(Level.SEVERE, null, ex);
        }
    }