Package org.aoju.bus.core.io.stream
Class QueueReader
java.lang.Object
java.io.Reader
org.aoju.bus.core.io.stream.QueueReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
队列InputStream
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intgetCol()intgetRow()booleanisEnd()是否结束intpeek()访问头部字节, 不删除intpeek(int index) 访问头部开始第几个字节, 不删除intpeekNext()访问上次peekNext访问的下个位置的字节, 未访问过则访问索引0, poll, peek后归零, 不删除intpoll()读取头部字节, 并删除intread(char[] cbuf, int off, int len) readItem(char... ends) 读取一项数据readLine()读取一行longskip(long n) 跳过和丢弃输入流中的数据boolean是否以 start 开始Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, read, ready, reset, transferTo
-
Constructor Details
-
QueueReader
-
-
Method Details
-
readItem
读取一项数据- Parameters:
ends- 结束符, 默认' ', '\r', '\n'- Returns:
- 数据
- Throws:
IOException- 异常
-
readLine
读取一行- Returns:
- 一行数据
- Throws:
IOException- 异常
-
poll
读取头部字节, 并删除- Returns:
- 头部字符
- Throws:
IOException- 异常
-
peek
访问头部开始第几个字节, 不删除- Parameters:
index- 索引- Returns:
- 头部的第N个字符
- Throws:
IOException- 异常
-
peekNext
访问上次peekNext访问的下个位置的字节, 未访问过则访问索引0, poll, peek后归零, 不删除- Returns:
- 下一个位置的字符
- Throws:
IOException- 异常
-
peek
访问头部字节, 不删除- Returns:
- 头部字符
- Throws:
IOException- 异常
-
skip
跳过和丢弃输入流中的数据- Overrides:
skipin classReader- Throws:
IOException
-
isEnd
public boolean isEnd()是否结束- Returns:
- true, 如果流已经结束
-
read
- Specified by:
readin classReader- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
startWith
是否以 start 开始- Parameters:
start- 开始位置- Returns:
- true, 如果的确以指定字符串开始
- Throws:
IOException- 异常
-
getCol
public int getCol() -
getRow
public int getRow()
-