public void addEntry(CRAIEntry entry) { craiIndex.addEntry(entry); }
public void addEntry(CRAIEntry entry) { craiIndex.addEntry(entry); }
/** * Read an input stream containing a .crai index and return a CRAIIndex object. * @param is Input stream to read * @return A CRAIIndex object representing the index. */ public static CRAIIndex readIndex(final InputStream is) { CRAIIndex craiIndex = new CRAIIndex(); Scanner scanner = null; try { scanner = new Scanner(new GZIPInputStream(is)); while (scanner.hasNextLine()) { final String line = scanner.nextLine(); craiIndex.addEntry(new CRAIEntry(line)); } } catch (IOException e) { throw new RuntimeIOException("Error reading CRAI index from output stream"); } finally { if (null != scanner) { scanner.close(); } } return craiIndex; }
/** * Read an input stream containing a .crai index and return a CRAIIndex object. * @param is Input stream to read * @return A CRAIIndex object representing the index. */ public static CRAIIndex readIndex(final InputStream is) { CRAIIndex craiIndex = new CRAIIndex(); Scanner scanner = null; try { scanner = new Scanner(new GZIPInputStream(is)); while (scanner.hasNextLine()) { final String line = scanner.nextLine(); craiIndex.addEntry(new CRAIEntry(line)); } } catch (IOException e) { throw new RuntimeIOException("Error reading CRAI index from output stream"); } finally { if (null != scanner) { scanner.close(); } } return craiIndex; }