private long timeAndCheckReadUnigramsAndBigramsBinary(
      final File file,
      final List<String> words,
      final SparseArray<List<Integer>> bigrams,
      final int bufferType,
      final boolean checkProbability) {
    final TreeMap<Integer, String> resultWords = new TreeMap<>();
    final TreeMap<Integer, ArrayList<PendingAttribute>> resultBigrams = new TreeMap<>();
    final TreeMap<Integer, Integer> resultFreqs = new TreeMap<>();

    long now = -1, diff = -1;
    try {
      final DictDecoder dictDecoder =
          BinaryDictIOUtils.getDictDecoder(file, 0, file.length(), bufferType);
      now = System.currentTimeMillis();
      dictDecoder.readUnigramsAndBigramsBinary(resultWords, resultFreqs, resultBigrams);
      diff = System.currentTimeMillis() - now;
    } catch (IOException e) {
      Log.e(TAG, "IOException", e);
    } catch (UnsupportedFormatException e) {
      Log.e(TAG, "UnsupportedFormatException", e);
    }

    checkWordMap(words, bigrams, resultWords, resultFreqs, resultBigrams, checkProbability);
    return diff;
  }