public class CsvUtil extends Object
Constructor and Description |
---|
CsvUtil() |
Modifier and Type | Method and Description |
---|---|
static CsvReader |
getReader()
获取CSV读取器,调用此方法创建的Reader须自行指定读取的资源
|
static CsvReader |
getReader(CsvReadConfig config)
获取CSV读取器,调用此方法创建的Reader须自行指定读取的资源
|
static CsvReader |
getReader(Reader reader)
获取CSV读取器
|
static CsvReader |
getReader(Reader reader,
CsvReadConfig config)
获取CSV读取器
|
static CsvWriter |
getWriter(File file,
Charset charset)
获取CSV生成器(写出器),使用默认配置,覆盖已有文件(如果存在)
|
static CsvWriter |
getWriter(File file,
Charset charset,
boolean isAppend)
获取CSV生成器(写出器),使用默认配置
|
static CsvWriter |
getWriter(File file,
Charset charset,
boolean isAppend,
CsvWriteConfig config)
获取CSV生成器(写出器)
|
static CsvWriter |
getWriter(String filePath,
Charset charset)
获取CSV生成器(写出器),使用默认配置,覆盖已有文件(如果存在)
|
static CsvWriter |
getWriter(String filePath,
Charset charset,
boolean isAppend)
获取CSV生成器(写出器),使用默认配置
|
static CsvWriter |
getWriter(Writer writer)
获取CSV生成器(写出器)
|
static CsvWriter |
getWriter(Writer writer,
CsvWriteConfig config)
获取CSV生成器(写出器)
|
public static CsvReader getReader(CsvReadConfig config)
config
- 配置, 允许为空.CsvReader
public static CsvReader getReader(Reader reader, CsvReadConfig config)
public static CsvWriter getWriter(String filePath, Charset charset)
filePath
- File CSV文件路径charset
- 编码CsvWriter
public static CsvWriter getWriter(File file, Charset charset)
file
- File CSV文件charset
- 编码CsvWriter
public static CsvWriter getWriter(String filePath, Charset charset, boolean isAppend)
filePath
- File CSV文件路径charset
- 编码isAppend
- 是否追加CsvWriter
public static CsvWriter getWriter(File file, Charset charset, boolean isAppend)
file
- File CSV文件charset
- 编码isAppend
- 是否追加CsvWriter
public static CsvWriter getWriter(File file, Charset charset, boolean isAppend, CsvWriteConfig config)
file
- File CSV文件charset
- 编码isAppend
- 是否追加config
- 写出配置,null则使用默认配置CsvWriter
public static CsvWriter getWriter(Writer writer)
writer
- WriterCsvWriter
public static CsvWriter getWriter(Writer writer, CsvWriteConfig config)
writer
- Writerconfig
- 写出配置,null则使用默认配置CsvWriter
Copyright © 2024. All rights reserved.