public class MultiReadable extends CharReadable.Adapter implements Closeable
CharReadable instances look like one. The provided readables should
be opened lazily, in Iterator.next(), and will be closed in here, if they implement Closeable.CharReadable.AdapterEMPTY| Constructor and Description |
|---|
MultiReadable(org.neo4j.collection.RawIterator<Reader,IOException> actual) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
position() |
int |
read(char[] into,
int offset,
int length)
Reads characters into the given array starting at
offset, reading length number of characters. |
SectionedCharBuffer |
read(SectionedCharBuffer buffer,
int from)
Reads characters into the
buffer. |
String |
sourceDescription() |
lineNumberequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlineNumberpublic MultiReadable(org.neo4j.collection.RawIterator<Reader,IOException> actual) throws IOException
IOExceptionpublic SectionedCharBuffer read(SectionedCharBuffer buffer, int from) throws IOException
CharReadablebuffer.
This method will block until data is available, an I/O error occurs, or the end of the stream is reached.
The caller is responsible for passing in from which index existing characters should be saved,
using compaction, before reading into the
front section of the buffer, using SectionedCharBuffer.readFrom(Reader).
The returned SectionedCharBuffer can be the same as got passed in, or another buffer if f.ex.
double-buffering is used. If this reader reached eof, i.e. equal state to that of Reader.read(char[])
returning -1 then SectionedCharBuffer.hasAvailable() for the returned instances will
return false.read in interface CharReadablebuffer - SectionedCharBuffer to read new data into.from - index into the buffer array where characters to save (compact) starts (inclusive).SectionedCharBuffer containing new data.IOException - if an I/O error occurs.public int read(char[] into,
int offset,
int length)
throws IOException
CharReadableoffset, reading length number of characters.
Similar to Reader.read(char[], int, int)read in interface CharReadableIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class CharReadable.AdapterIOExceptionpublic long position()
position in interface SourceTraceabilityposition in class SourceTraceability.Adapterpublic String sourceDescription()
sourceDescription in interface SourceTraceabilityCopyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.