Package io.r2mo.io.local.operation
Class FileRangeInputStream
java.lang.Object
java.io.InputStream
io.r2mo.io.local.operation.FileRangeInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Method Summary
Modifier and TypeMethodDescriptionstatic InputStreamgetInputStream(Path filePath, long start, long end) 获取大文件指定部分的输入流intread()Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Method Details
-
getInputStream
获取大文件指定部分的输入流- Parameters:
filePath- 文件路径start- 起始位置(包含)end- 结束位置(不包含)- Returns:
- 指定范围的输入流
- Throws:
IOException- 如果文件不存在或读取失败
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-