public class ThreadAheadReadable extends ThreadAhead implements CharReadable
CharReadable, it's just that the reading happens in a separate thread, so when
a consumer wants to read(SectionedCharBuffer, int) more data it's already available, merely a memcopy away.Thread.State, Thread.UncaughtExceptionHandlerCharReadable.AdapterMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITYEMPTY| Modifier and Type | Method and Description |
|---|---|
long |
lineNumber()
1-based line number of the current data source.
|
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)
The one calling read doesn't actually read, since reading is up to the thread in here.
|
String |
sourceDescription() |
static CharReadable |
threadAhead(CharReadable actual,
int bufferSize) |
close, runactiveCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic SectionedCharBuffer read(SectionedCharBuffer buffer, int from) throws IOException
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 long position()
position in interface SourceTraceabilitypublic String sourceDescription()
sourceDescription in interface SourceTraceabilitypublic long lineNumber()
SourceTraceabilitylineNumber in interface SourceTraceabilitypublic static CharReadable threadAhead(CharReadable actual, int bufferSize)
Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.