public class ReaderCharSequence extends Object implements CharSequence
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUFFER_LENGTH |
static int |
DEFAULT_LOOKAHEAD |
static int |
INFINITE_LENGTH
Value to be used as length when it is unknown.
|
| Constructor and Description |
|---|
ReaderCharSequence(Reader reader) |
ReaderCharSequence(Reader reader,
int bufferLength) |
ReaderCharSequence(Reader reader,
int bufferLength,
int length) |
ReaderCharSequence(Reader reader,
int bufferLength,
int length,
int lookahead)
Create.
|
| Modifier and Type | Method and Description |
|---|---|
char |
charAt(int index) |
int |
length() |
CharSequence |
subSequence(int start,
int end)
The length of returned subsequence can be smaller than (end - start) when
the end of stream is reached.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchars, codePoints, toStringpublic static final int DEFAULT_BUFFER_LENGTH
public static final int DEFAULT_LOOKAHEAD
public static final int INFINITE_LENGTH
Integer.MAX_VALUE because some code may add something to length.public ReaderCharSequence(Reader reader, int bufferLength, int length, int lookahead)
reader - reader from which char sequence will be readbufferLength - size of the character bufferlength - length of the input; when it cannot be determined it can
be set to INFINITE_LENGTH (max value); cannot be set to
Integer.MAX_VALUE because it may cause overflow.lookahead - number of characters to read after current positionpublic ReaderCharSequence(Reader reader, int bufferLength, int length)
public ReaderCharSequence(Reader reader, int bufferLength)
public ReaderCharSequence(Reader reader)
public int length()
length in interface CharSequencepublic char charAt(int index)
charAt in interface CharSequencepublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequenceCopyright © 2018. All Rights Reserved.