@Override public void reset() { index = 0; try { inputStream.position(0); } catch (IOException e) { LOG.error("Unable to reset iterator to position 0"); } }
@Override public void reset() { index = 0; try { inputStream.position(0); } catch (IOException e) { LOG.error("Unable to reset iterator to position 0"); } }
public MutableString get(final int index, final FastBufferedInputStream fastBufferedInputStream, final ByteBuffer byteBuffer, final CharBuffer charBuffer, final CharsetDecoder decoder) { try { fastBufferedInputStream.position(borders.getLong(index)); byteBuffer.clear(); byteBuffer.limit(fastBufferedInputStream.readLine(byteBuffer.array(), terminators)); charBuffer.clear(); decoder.decode(byteBuffer, charBuffer, true); return new MutableString(charBuffer.array(), 0, charBuffer.position()); } catch (final IOException e) { throw new RuntimeException(e); } }
public MutableString get(final long index, final FastBufferedInputStream fastBufferedInputStream, final ByteBuffer byteBuffer, final CharBuffer charBuffer, final CharsetDecoder decoder) { try { fastBufferedInputStream.position(borders.getLong(index)); byteBuffer.clear(); byteBuffer.limit(fastBufferedInputStream.readLine(byteBuffer.array(), terminators)); charBuffer.clear(); decoder.decode(byteBuffer, charBuffer, true); return new MutableString(charBuffer.array(), 0, charBuffer.position()); } catch (final IOException e) { throw new RuntimeException(e); } }
@Override public long nextLong() { if (! hasNext()) throw new NoSuchElementException(); pos++; try { final long result = inputStream.position(); inputStream.readLine(buffer, terminators); return result; } catch (final IOException e) { throw new RuntimeException(e); } } });
@Override public long nextLong() { if (! hasNext()) throw new NoSuchElementException(); pos++; try { final long result = inputStream.position(); inputStream.readLine(buffer, terminators); return result; } catch (final IOException e) { throw new RuntimeException(e); } } });
public MutableString term( final int index ) throws IOException { MutableString s = new MutableString(); termsInputStream.position( termOffsets.getLong( index ) ); return s.readSelfDelimUTF8( termsInputStream ); }
charBuffer = CharBuffer.wrap(new char[array.length]); inputStream.position(0); borders = new EliasFanoMonotoneLongBigList(count, inputStream.length(), new LongIterator() { long pos = 0;
charBuffer = CharBuffer.wrap(new char[array.length]); inputStream.position(0); borders = new EliasFanoMonotoneLongBigList(count, inputStream.length(), new LongIterator() { long pos = 0;