@Test public void iterator_using_bytebuffer() throws Exception { final MappedByteBuffer buf; try (FileChannel fd = FileChannel.open(tmpfile, READ)) { buf = fd.map(FileChannel.MapMode.READ_ONLY, 0, fd.size()); } XdrStreamIterator iter = new XdrStreamIterator(buf); assertTrue(buf.position() > 0); assertTrue(iter.hasNext()); List<TimeSeriesCollection> read_tsdata = new ArrayList<>(); iter.forEachRemaining(read_tsdata::add); assertFalse(buf.hasRemaining()); assertEquals(tsdata, read_tsdata); }
@Override public boolean hasNext() { try { LOG.log(Level.FINEST, "hasNext: {0}, counter: {1}", new Object[]{!data_.atEof(), counter_}); return !data_.atEof(); } catch (IOException ex) { LOG.log(Level.SEVERE, "error accessing data file", ex); return true; } }
XdrStreamIterator implements Iterator<TimeSeriesCollection> { @Override public boolean hasNext() { try { LOG.log(Level.FINEST, "hasNext: {0}, counter: {1}", new Object[]{!data_.atEof(), counter_}); return !data_.atEof(); } catch (IOException ex) { LOG.log(Level.SEVERE, "error accessing data file", ex); return true; } } }
XdrStreamIterator implements Iterator<TimeSeriesCollection> { @Override public boolean hasNext() { try { LOG.log(Level.FINEST, "hasNext: {0}, counter: {1}", new Object[]{!data_.atEof(), counter_}); return !data_.atEof(); } catch (IOException ex) { LOG.log(Level.SEVERE, "error accessing data file", ex); return true; } } XdrStreamIterator(XdrBufferDecodingStream data);  XdrStreamIterator(BufferSupplier data);  XdrStreamIterator(ByteBuffer buf, BufferSupplier data);  XdrStreamIterator(ByteBuffer data); }
XdrStreamIterator implements Iterator<TimeSeriesCollection> { @Override public boolean hasNext() { try { LOG.log(Level.FINEST, "hasNext: {0}, counter: {1}", new Object[]{!data_.atEof(), counter_}); return !data_.atEof(); } catch (IOException ex) { LOG.log(Level.SEVERE, "error accessing data file", ex); return true; } } XdrStreamIterator(XdrBufferDecodingStream data);  XdrStreamIterator(BufferSupplier data);  XdrStreamIterator(ByteBuffer buf, BufferSupplier data);  XdrStreamIterator(ByteBuffer data); @Override boolean hasNext(); @Override TimeSeriesCollection next(); }
XdrStreamIterator implements Iterator<TimeSeriesCollection> { @Override public boolean hasNext() { try { LOG.log(Level.FINEST, "hasNext: {0}, counter: {1}", new Object[]{!data_.atEof(), counter_}); return !data_.atEof(); } catch (IOException ex) { LOG.log(Level.SEVERE, "error accessing data file", ex); return true; } } XdrStreamIterator(XdrBufferDecodingStream data);  XdrStreamIterator(BufferSupplier data);  XdrStreamIterator(ByteBuffer buf, BufferSupplier data);  XdrStreamIterator(ByteBuffer data); @Override boolean hasNext(); @Override TimeSeriesCollection next();  }