public class NioFileTools extends Object
Constructor and Description |
---|
NioFileTools() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
readOneFileToByte(File file)
nio基于缓冲区读取指定路径的一个文件
可用于读取大文件,在硬件配置足够的情况下 |
static byte[] |
readOneFileToByte(String pathname)
nio基于缓冲区读取指定路径的一个文件
可用于读取大文件,在硬件配置足够的情况下 |
static byte[] |
readOneFileToByte(String pathname,
IStreamProgress streamProgress)
nio基于缓冲区读取指定路径的一个文件
可用于读取大文件,在硬件配置足够的情况下 |
static String |
readOneFileToString(String pathname,
String charsetName)
读取一个文件内容,并转换为字符串格式
|
static List<byte[]> |
readSomeFile(IStreamProgress streamProgress,
String... pathnames)
读取多个文件 到 列表
|
static List<byte[]> |
readSomeFile(String... pathnames)
读取多个文件 到 列表
|
static String |
readSomeFileToStr(String charsetName,
char linkChar,
String... pathnames)
读取多个文件,并合并成一条字符串
|
static List<String> |
readSomeFileToStrs(IStreamProgress streamProgress,
String charsetName,
String... pathnames)
读取多个文件 到 字符串列表
|
static List<String> |
readSomeFileToStrs(String charsetName,
String... pathnames)
读取多个文件 到 字符串列表
|
public static byte[] readOneFileToByte(File file) throws IOException
file
- IOException
public static byte[] readOneFileToByte(String pathname) throws IOException
pathname
- 文件所在路径IOException
public static byte[] readOneFileToByte(String pathname, IStreamProgress streamProgress) throws IOException
pathname
- streamProgress
- 文件数据流读取进度条IOException
public static String readOneFileToString(String pathname, String charsetName) throws IOException
pathname
- IOException
public static List<byte[]> readSomeFile(IStreamProgress streamProgress, String... pathnames) throws IOException
streamProgress
- pathnames
- IOException
public static List<byte[]> readSomeFile(String... pathnames) throws IOException
pathnames
- IOException
public static List<String> readSomeFileToStrs(String charsetName, String... pathnames) throws IOException
pathnames
- charsetName
- IOException
public static List<String> readSomeFileToStrs(IStreamProgress streamProgress, String charsetName, String... pathnames) throws IOException
pathnames
- charsetName
- IOException
public static String readSomeFileToStr(String charsetName, char linkChar, String... pathnames) throws IOException
pathnames
- 读取的源文件集合charsetName
- 字符编码名称linkChar
- 多文件合并的连接符号,缺省为“”空字符串IOException
Copyright © 2018. All rights reserved.