java.lang.Object
develop.toolkit.base.utils.FileAdvice
- Author:
- qiushui on 2021-03-15.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription遍历目录 找到所有满足条件的文件static longsliceBytes(int bufferSize, long offset, long chunkSize, File file, OutputStream out) 截取文件中某一段的字节数据static voidstatic voidwrite(Path filePath, CharSequence text, Charset charset, boolean append) static voidwrite(Path filePath, Iterable<? extends CharSequence> lines, Charset charset, boolean append)
-
Constructor Details
-
FileAdvice
public FileAdvice()
-
-
Method Details
-
write
-
write
public static void write(Path filePath, Iterable<? extends CharSequence> lines, Charset charset, boolean append) -
touch
- Throws:
IOException
-
files
遍历目录 找到所有满足条件的文件 -
sliceBytes
public static long sliceBytes(int bufferSize, long offset, long chunkSize, File file, OutputStream out) throws IOException 截取文件中某一段的字节数据- Parameters:
bufferSize- 缓冲区大小offset- 偏移量chunkSize- 截取块大小file- 文件 内部会采用随机读取文件RandomAccessFileout- 输出流- Throws:
IOException- IO异常
-