public class ParallelReader extends Reader
Modifier and Type | Class and Description |
---|---|
static interface |
ParallelReader.WaitingStrategy |
Constructor and Description |
---|
ParallelReader(Reader reader)
Create a new ParallelReader that will fetch the data from that reader in a another thread.
|
ParallelReader(Reader reader,
Executor executorService) |
ParallelReader(Reader reader,
Executor executorService,
int bufferSize) |
ParallelReader(Reader reader,
Executor executorService,
int bufferSize,
int readBufferSize) |
ParallelReader(Reader reader,
Executor executorService,
int bufferSize,
int readBufferSize,
ParallelReader.WaitingStrategy waitingStrategy)
Create a new ParallelReader.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
static Executor |
getDefaultExecutor() |
int |
read() |
int |
read(char[] cbuf,
int off,
int len) |
public ParallelReader(Reader reader)
reader
- the readerpublic ParallelReader(Reader reader, Executor executorService, int bufferSize, int readBufferSize)
public ParallelReader(Reader reader, Executor executorService, int bufferSize, int readBufferSize, ParallelReader.WaitingStrategy waitingStrategy)
reader
- the readerexecutorService
- the executor to fetch frombufferSize
- the size of the ring bufferreadBufferSize
- the size of the buffer to fetch datawaitingStrategy
- the waiting strategy when the ring buffer is fullpublic static Executor getDefaultExecutor()
public int read() throws IOException
read
in class Reader
IOException
public int read(char[] cbuf, int off, int len) throws IOException
read
in class Reader
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Reader
IOException
Copyright © 2020. All rights reserved.