Examples of seek()


Examples of org.apache.jackrabbit.core.fs.RandomAccessOutputStream.seek()

                if (fs.exists(fileName)) {
                    len = fs.length(fileName);
                }
                RandomAccessOutputStream raos
                        = fs.getRandomAccessOutputStream(fileName);
                raos.seek(len);
                // use buffering
                out = new OutputStreamWriter(
                        new BufferedOutputStream(raos, 1024),
                        ENCODING);
            } catch (FileSystemException e) {
View Full Code Here

Examples of org.apache.lucene.index.TermDocs.seek()

              + MAX_VAL_COUNT);
        }
        String val = term.text();
        mterms.add(val);
        int bit = (0x00000001 << (t-1));
        termDocs.seek(termEnum);
        //freqList.add(termEnum.docFreq());  // removed because the df doesn't take into account the num of deletedDocs
        int df = 0;
        int minID=-1;
            int maxID=-1;
            if(termDocs.next())
View Full Code Here

Examples of org.apache.lucene.index.TermPositions.seek()

    TermPositions termPositions = reader.termPositions(new Term("preanalyzed", "term1"));
    assertTrue(termPositions.next());
    assertEquals(1, termPositions.freq());
    assertEquals(0, termPositions.nextPosition());

    termPositions.seek(new Term("preanalyzed", "term2"));
    assertTrue(termPositions.next());
    assertEquals(2, termPositions.freq());
    assertEquals(1, termPositions.nextPosition());
    assertEquals(3, termPositions.nextPosition());
   
View Full Code Here

Examples of org.apache.lucene.store.BufferedChecksumIndexInput.seek()

  public static long checksumEntireFile(IndexInput input) throws IOException {
    IndexInput clone = input.clone();
    clone.seek(0);
    ChecksumIndexInput in = new BufferedChecksumIndexInput(clone);
    assert in.getFilePointer() == 0;
    in.seek(in.length() - footerLength());
    return checkFooter(in);
  }
}
View Full Code Here

Examples of org.apache.lucene.store.ChecksumIndexInput.seek()

  public static long checksumEntireFile(IndexInput input) throws IOException {
    IndexInput clone = input.clone();
    clone.seek(0);
    ChecksumIndexInput in = new BufferedChecksumIndexInput(clone);
    assert in.getFilePointer() == 0;
    in.seek(in.length() - footerLength());
    return checkFooter(in);
  }
}
View Full Code Here

Examples of org.apache.lucene.store.IndexInput.seek()

      } catch (IOException ioe) {
        if (format == FORMAT_PRE) {
          // LUCENE-1623: FORMAT_PRE (before there was a
          // format) may be 2.3.2 (pre-utf8) or 2.4.x (utf8)
          // encoding; retry with input set to pre-utf8
          input.seek(0);
          input.setModifiedUTF8StringsMode();
          byNumber.clear();
          byName.clear();
          try {
            read(input, name);
View Full Code Here

Examples of org.apache.lucene.store.IndexOutput.seek()

                copyFile(fe, os);
            }

            // Write the data offsets into the directory of the compound stream
            for (FileEntry fe : entries) {
                os.seek(fe.directoryOffset);
                os.writeLong(fe.dataOffset);
            }

            assert finalLength == os.length();
View Full Code Here

Examples of org.apache.lucene.store.InputStream.seek()

        // ERROR: this call should fail, but succeeds because the buffer
        // is still filled
        b = in.readByte();

        // ERROR: this call should fail, but succeeds for some reason as well
        in.seek(1099);

        try {
            // OK: this call correctly fails. We are now past the 1024 internal
            // buffer, so an actual IO is attempted, which fails
            b = in.readByte();
View Full Code Here

Examples of org.apache.lucene.store.OutputStream.seek()

            // Write the data offsets into the directory of the compound stream
            it = entries.iterator();
            while(it.hasNext()) {
                FileEntry fe = (FileEntry) it.next();
                os.seek(fe.directoryOffset);
                os.writeLong(fe.dataOffset);
            }

            // Close the output stream. Set the os to null before trying to
            // close so that if an exception occurs during the close, the
View Full Code Here

Examples of org.apache.nutch.fs.NFSDataInputStream.seek()

    final long end = start + split.getLength();

    // open the file and seek to the start of the split
    final NFSDataInputStream in =
      new NFSDataInputStream(fs.open(split.getFile()));
    in.seek(start);
   
    if (start != 0) {
      while (in.getPos() < end) {    // scan to the next newline in the file
        char c = (char)in.read();
        if (c == '\r' || c == '\n') {
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.