Package | Description |
---|---|
cn.hutool.core.io |
IO相关封装和工具类,包括Inputstream和OutputStream实现类,工具包括流工具IoUtil、文件工具FileUtil和Buffer工具BufferUtil
|
Modifier and Type | Method and Description |
---|---|
static LineIter |
IoUtil.lineIter(InputStream in,
Charset charset)
返回行遍历器
LineIterator it = null;
try {
it = IoUtil.lineIter(in, CharsetUtil.CHARSET_UTF_8);
while (it.hasNext()) {
String line = it.nextLine();
// do something with line
}
} finally {
it.close();
}
|
static LineIter |
IoUtil.lineIter(Reader reader)
返回行遍历器
LineIterator it = null;
try {
it = IoUtil.lineIter(reader);
while (it.hasNext()) {
String line = it.nextLine();
// do something with line
}
} finally {
it.close();
}
|
Copyright © 2024. All rights reserved.