Tabnine Logo
SeekableLineReaderIterator
Code IndexAdd Tabnine to your IDE (free)

How to use
SeekableLineReaderIterator
in
org.archive.util.binsearch

Best Java code snippets using org.archive.util.binsearch.SeekableLineReaderIterator (Showing top 20 results out of 315)

origin: org.netpreserve.commons/commons-web

public CachedStringIterator(SeekableLineReader slr, String first, String second) {
  this.slr = slr;
  this.first = first;
  this.second = second;
  if (slr != null) {
    it = new SeekableLineReaderIterator(slr);
  }
}

origin: org.netpreserve.commons/commons-web

public boolean hasNext() {
  if(first != null) {
    return true;
  }
  if(second != null) {
    return true;
  }
  if (it == null) {
    return false;
  }
  return it.hasNext();
}
origin: org.netpreserve.commons/commons-web

public String next() {
  if(first != null) {
    String tmp = first;
    first = null;
    return tmp;
  }
  if(second != null) {
    String tmp = second;
    second = null;
    return tmp;
  }
  if (it == null) {
    return null;
  }            
  return it.next();
}
origin: org.netpreserve.openwayback/openwayback-cdx-server

public void loadParamFile() throws IOException {
  SeekableLineReaderFactory fact = null;
  SeekableLineReaderIterator iter = null;
  try {
    fact = GeneralURIStreamFactory.createSeekableStreamFactory(
      paramFile, false);
    iter = new SeekableLineReaderIterator(fact.get());
    paramSet = new HashSet<String>();
    while (iter.hasNext()) {
      String param = iter.next();
      param = param.trim();
      if (param.isEmpty() || param.startsWith("#")) {
        continue;
      }
      // Use only the first word, ignore the rest
      int wordEnd = param.indexOf(delim);
      if (wordEnd > 0) {
        param = param.substring(0, wordEnd);
      }
      paramSet.add(param);
    }
  } finally {
    if (iter != null) {
      iter.close();
    }
    if (fact != null) {
      fact.close();
    }
  }
}
origin: iipc/openwayback

public void loadParamFile() throws IOException {
  SeekableLineReaderFactory fact = null;
  SeekableLineReaderIterator iter = null;
  try {
    fact = GeneralURIStreamFactory.createSeekableStreamFactory(
      paramFile, false);
    iter = new SeekableLineReaderIterator(fact.get());
    paramSet = new HashSet<String>();
    while (iter.hasNext()) {
      String param = iter.next();
      param = param.trim();
      if (param.isEmpty() || param.startsWith("#")) {
        continue;
      }
      // Use only the first word, ignore the rest
      int wordEnd = param.indexOf(delim);
      if (wordEnd > 0) {
        param = param.substring(0, wordEnd);
      }
      paramSet.add(param);
    }
  } finally {
    if (iter != null) {
      iter.close();
    }
    if (fact != null) {
      fact.close();
    }
  }
}
origin: org.netpreserve.commons/webarchive-commons

lines = new SeekableLineReaderIterator(locReaderFactory.get());
while (lines.hasNext()) {
  String line = lines.next();
  lines.close();
origin: org.netpreserve.commons/webarchive-commons

public CachedStringIterator(SeekableLineReader slr, String first, String second) {
  this.slr = slr;
  this.first = first;
  this.second = second;
  if (slr != null) {
    it = new SeekableLineReaderIterator(slr);
  }
}

origin: org.netpreserve.commons/webarchive-commons

public boolean hasNext() {
  if(first != null) {
    return true;
  }
  if(second != null) {
    return true;
  }
  if (it == null) {
    return false;
  }
  return it.hasNext();
}
origin: org.netpreserve.commons/webarchive-commons

public String next() {
  if(first != null) {
    String tmp = first;
    first = null;
    return tmp;
  }
  if(second != null) {
    String tmp = second;
    second = null;
    return tmp;
  }
  if (it == null) {
    return null;
  }            
  return it.next();
}
origin: org.netpreserve.commons/commons-web

lines = new SeekableLineReaderIterator(locReaderFactory.get());
while (lines.hasNext()) {
  String line = lines.next();
  lines.close();
origin: iipc/webarchive-commons

public CachedStringIterator(SeekableLineReader slr, String first, String second) {
  this.slr = slr;
  this.first = first;
  this.second = second;
  if (slr != null) {
    it = new SeekableLineReaderIterator(slr);
  }
}

origin: iipc/webarchive-commons

public boolean hasNext() {
  if(first != null) {
    return true;
  }
  if(second != null) {
    return true;
  }
  if (it == null) {
    return false;
  }
  return it.hasNext();
}
origin: iipc/webarchive-commons

public String next() {
  if(first != null) {
    String tmp = first;
    first = null;
    return tmp;
  }
  if(second != null) {
    String tmp = second;
    second = null;
    return tmp;
  }
  if (it == null) {
    return null;
  }            
  return it.next();
}
origin: iipc/webarchive-commons

lines = new SeekableLineReaderIterator(locReaderFactory.get());
while (lines.hasNext()) {
  String line = lines.next();
  lines.close();
origin: org.netpreserve.commons/commons-web

public CloseableIterator<String> getRecordIterator(final long offset) throws IOException
{
  SeekableLineReader slr = factory.get();
  slr.seek(offset);
  return new SeekableLineReaderIterator(slr);
}
origin: org.netpreserve.commons/webarchive-commons

public CloseableIterator<String> getRecordIterator(final long offset) throws IOException
{
  SeekableLineReader slr = factory.get();
  slr.seek(offset);
  return new SeekableLineReaderIterator(slr);
}
origin: iipc/webarchive-commons

public CloseableIterator<String> getRecordIterator(final long offset) throws IOException
{
  SeekableLineReader slr = factory.get();
  slr.seek(offset);
  return new SeekableLineReaderIterator(slr);
}
origin: iipc/openwayback

protected CloseableIterator<String> createRemoteIter(String urlkey,
    HTTPSeekableLineReader reader) throws IOException {
  CloseableIterator<String> iter = new SeekableLineReaderIterator(reader);
  String cacheInfo = reader.getHeaderValue("X-Page-Cache");
  if ((cacheInfo != null) && cacheInfo.equals("HIT")) {
    if (LOGGER.isLoggable(Level.FINE)) {
      LOGGER.fine("CACHED");
    }
  }
  if (extraSource != null) {
    ZipNumParams params = new ZipNumParams();
    CloseableIterator<String> extraIter = extraSource.getCDXIterator(
        urlkey, urlkey, urlkey, params);
    if (extraIter.hasNext()) {
      SortedCompositeIterator<String> sortedIter = new SortedCompositeIterator<String>(
          MultiCDXInputSource.defaultComparator);
      sortedIter.addIterator(iter);
      sortedIter.addIterator(extraIter);
      return sortedIter;
    }
  }
  return iter;
}
origin: org.netpreserve.openwayback/openwayback-core

protected CloseableIterator<String> createRemoteIter(String urlkey,
    HTTPSeekableLineReader reader) throws IOException {
  CloseableIterator<String> iter = new SeekableLineReaderIterator(reader);
  String cacheInfo = reader.getHeaderValue("X-Page-Cache");
  if ((cacheInfo != null) && cacheInfo.equals("HIT")) {
    if (LOGGER.isLoggable(Level.FINE)) {
      LOGGER.fine("CACHED");
    }
  }
  if (extraSource != null) {
    ZipNumParams params = new ZipNumParams();
    CloseableIterator<String> extraIter = extraSource.getCDXIterator(
        urlkey, urlkey, urlkey, params);
    if (extraIter.hasNext()) {
      SortedCompositeIterator<String> sortedIter = new SortedCompositeIterator<String>(
          MultiCDXInputSource.defaultComparator);
      sortedIter.addIterator(iter);
      sortedIter.addIterator(extraIter);
      return sortedIter;
    }
  }
  return iter;
}
origin: org.netpreserve.commons/webarchive-commons

CloseableIterator<String> slrIter = new SeekableLineReaderIterator(currReader, zipnumIndex.isRequired());
org.archive.util.binsearchSeekableLineReaderIterator

Most used methods

  • <init>
  • close
  • hasNext
  • next

Popular in Java

  • Making http requests using okhttp
  • requestLocationUpdates (LocationManager)
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • JComboBox (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now