public class TextReader extends Reader
-1 as the maxReadSize
will disable reading in batch and will read the entire text all at once.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_READ_SIZE |
| Constructor and Description |
|---|
TextReader(Reader reader)
Create a new text reader, reading a maximum of 10 million characters
at a time when
readText() is called. |
TextReader(Reader reader,
int maxReadSize)
Constructor.
|
TextReader(Reader reader,
int maxReadSize,
boolean removeTrailingDelimiter)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
read(char[] cbuf,
int off,
int len) |
String |
readText()
Reads the next chunk of text, up to the maximum read size specified.
|
public static final int DEFAULT_MAX_READ_SIZE
public TextReader(Reader reader)
readText() is called.reader - a Readerpublic TextReader(Reader reader, int maxReadSize)
reader - a ReadermaxReadSize - maximum to read at once with readText().public TextReader(Reader reader, int maxReadSize, boolean removeTrailingDelimiter)
reader - a ReadermaxReadSize - maximum to read at once with readText().removeTrailingDelimiter - whether to remove trailing delimiterpublic int read(char[] cbuf,
int off,
int len)
throws IOException
read in class ReaderIOExceptionpublic String readText() throws IOException
IOException - problem reading text.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOExceptionCopyright © 2008–2021 Norconex Inc.. All rights reserved.