Package org.miaixz.bus.core.io
Class LineReader
java.lang.Object
java.io.Reader
org.miaixz.bus.core.io.ReaderWrapper
org.miaixz.bus.core.io.LineReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<String>,Readable,Wrapper<Reader>,Provider
行读取器,类似于BufferedInputStream,支持多行转义,规则如下:
- 支持'\n'和'\r\n'两种换行符,不支持'\r'换行符
- 如果想读取转义符,必须定义为'\\'
- 多行转义后的换行符和空格都会被忽略
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields inherited from class org.miaixz.bus.core.io.ReaderWrapper
raw -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.miaixz.bus.core.io.ReaderWrapper
close, getRaw, mark, markSupported, read, read, read, read, ready, reset, skipMethods inherited from class java.io.Reader
nullReader, transferToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
LineReader
构造- Parameters:
in-InputStreamcharset- 编码
-
LineReader
构造- Parameters:
reader-Reader
-
-
Method Details
-
readLine
读取一行- Returns:
- 内容
- Throws:
IOException- IO异常
-
iterator
-