public class FastStringReader extends Reader
| Constructor and Description |
|---|
FastStringReader(String s)
构造
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
mark(int readAheadLimit) |
boolean |
markSupported() |
int |
read()
读取单个字符
|
int |
read(char[] charBuffer,
int off,
int len)
将多个字符读取到提供的字符数组中
|
boolean |
ready() |
void |
reset() |
long |
skip(long ns)
跳过指定长度,返回跳过的字符数。
|
public FastStringReader(String s)
s - 供读取的Stringpublic int read()
throws IOException
read in class ReaderIOException - IO异常public int read(char[] charBuffer,
int off,
int len)
throws IOException
read in class ReadercharBuffer - 目标bufferoff - 开始位置len - 读取最大长度IOException - IO异常public long skip(long ns)
throws IOException
ns 参数可能为负数, 负数表示向前跳过,跳到开头则停止
如果字符串所有字符被读取或跳过, 此方法无效,始终返回0.
skip in class ReaderIOException - IO异常public boolean ready()
throws IOException
ready in class ReaderIOExceptionpublic boolean markSupported()
markSupported in class Readerpublic void mark(int readAheadLimit)
throws IOException
mark in class ReaderIOExceptionpublic void reset()
throws IOException
reset in class ReaderIOExceptionCopyright © 2024. All rights reserved.