Class FileRangeInputStream

java.lang.Object
java.io.InputStream
io.r2mo.io.local.operation.FileRangeInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class FileRangeInputStream extends InputStream
  • Method Details

    • getInputStream

      public static InputStream getInputStream(Path filePath, long start, long end) throws IOException
      获取大文件指定部分的输入流
      Parameters:
      filePath - 文件路径
      start - 起始位置(包含)
      end - 结束位置(不包含)
      Returns:
      指定范围的输入流
      Throws:
      IOException - 如果文件不存在或读取失败
    • read

      public int read() throws IOException
      Specified by:
      read in class InputStream
      Throws:
      IOException