Class FileOperator

java.lang.Object
org.aoju.bus.core.io.FileOperator

public final class FileOperator extends Object
读取和写入目标文件
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • FileOperator

      public FileOperator(FileChannel fileChannel)
  • Method Details

    • write

      public void write(long pos, Buffer source, long byteCount) throws IOException
      byteCount字节从source写到pos的文件中
      Parameters:
      pos - 写入大小
      source - 缓存流信息
      byteCount - 字节流大小
      Throws:
      IOException - 异常
    • read

      public void read(long pos, Buffer sink, long byteCount) throws IOException
      byteCount字节从文件pos复制到source 调用者有责任确保有足够的字节来读取:如果没有,这个方法会抛出一个EOFException
      Parameters:
      pos - 写入大小
      sink - 缓存流信息
      byteCount - 字节流大小
      Throws:
      IOException - 异常