Package org.apache.lucene.store

Examples of org.apache.lucene.store.DataInput.readVInt()


      CodecUtil.checkHeader(in, TARGETMAP_HEADER, VERSION, VERSION);
      targetMap = new int[in.readVInt()];
      targetMapOffsets = new int[in.readVInt()];
      int accum = 0, sourceId = 0;
      for (int ofs = 0; ofs < targetMap.length; ofs++) {
        final int val = in.readVInt();
        if ((val & 0x01) != 0) {
          targetMapOffsets[sourceId] = ofs;
          sourceId++;
        }
        accum += val >>> 1;
View Full Code Here


     
      posIS = getResource(POSDICT_FILENAME_SUFFIX);
      posIS = new BufferedInputStream(posIS);
      in = new InputStreamDataInput(posIS);
      CodecUtil.checkHeader(in, POSDICT_HEADER, VERSION, VERSION);
      int posSize = in.readVInt();
      posDict = new String[posSize];
      inflTypeDict = new String[posSize];
      inflFormDict = new String[posSize];
      for (int j = 0; j < posSize; j++) {
        posDict[j] = in.readString();
View Full Code Here

     
      dictIS = getResource(DICT_FILENAME_SUFFIX);
      // no buffering here, as we load in one large buffer
      in = new InputStreamDataInput(dictIS);
      CodecUtil.checkHeader(in, DICT_HEADER, VERSION, VERSION);
      final int size = in.readVInt();
      final ByteBuffer tmpBuffer = ByteBuffer.allocateDirect(size);
      final ReadableByteChannel channel = Channels.newChannel(dictIS);
      final int read = channel.read(tmpBuffer);
      if (read != size) {
        throw new EOFException("Cannot read whole dictionary");
View Full Code Here

    try {
      is = BinaryDictionary.getClassResource(getClass(), FILENAME_SUFFIX);
      is = new BufferedInputStream(is);
      final DataInput in = new InputStreamDataInput(is);
      CodecUtil.checkHeader(in, HEADER, VERSION, VERSION);
      int forwardSize = in.readVInt();
      int backwardSize = in.readVInt();
      costs = new short[backwardSize][forwardSize];
      int accum = 0;
      for (int j = 0; j < costs.length; j++) {
        final short[] a = costs[j];
View Full Code Here

      is = BinaryDictionary.getClassResource(getClass(), FILENAME_SUFFIX);
      is = new BufferedInputStream(is);
      final DataInput in = new InputStreamDataInput(is);
      CodecUtil.checkHeader(in, HEADER, VERSION, VERSION);
      int forwardSize = in.readVInt();
      int backwardSize = in.readVInt();
      costs = new short[backwardSize][forwardSize];
      int accum = 0;
      for (int j = 0; j < costs.length; j++) {
        final short[] a = costs[j];
        for (int i = 0; i < a.length; i++) {
View Full Code Here

      costs = new short[backwardSize][forwardSize];
      int accum = 0;
      for (int j = 0; j < costs.length; j++) {
        final short[] a = costs[j];
        for (int i = 0; i < a.length; i++) {
          int raw = in.readVInt();
          accum += (raw >>> 1) ^ -(raw & 1);
          a[i] = (short)accum;
        }
      }
    } catch (IOException ioe) {
View Full Code Here

     */
    protected boolean loadFieldNameFilterConverter(Directory directory, String geoFileName,
            IFieldNameFilterConverter fieldNameFilterConverter) throws IOException {
        try {
            DataInput input = directory.openInput(geoFileName);
            input.readVInt()//read version
            input.readInt();   //throw out tree position
            input.readVInt()//throw out tree size
            input.readVInt()//throw out record length
       
            fieldNameFilterConverter.loadFromInput(input);
View Full Code Here

            IFieldNameFilterConverter fieldNameFilterConverter) throws IOException {
        try {
            DataInput input = directory.openInput(geoFileName);
            input.readVInt()//read version
            input.readInt();   //throw out tree position
            input.readVInt()//throw out tree size
            input.readVInt()//throw out record length
       
            fieldNameFilterConverter.loadFromInput(input);
       
            return true;
View Full Code Here

        try {
            DataInput input = directory.openInput(geoFileName);
            input.readVInt()//read version
            input.readInt();   //throw out tree position
            input.readVInt()//throw out tree size
            input.readVInt()//throw out record length
       
            fieldNameFilterConverter.loadFromInput(input);
       
            return true;
        } catch (FileNotFoundException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.