public class FileWriters extends Object
Modifier and Type | Method and Description |
---|---|
static void |
append(File file,
byte[] bs) |
static void |
append(File file,
byte[] bs,
int off,
int len)
拼接到文件最后一行
|
static void |
append(File file,
long offset,
byte[] bytes) |
static void |
append(File file,
long offset,
byte[] bytes,
int off,
int len)
拼接到偏移处
|
static void |
append(File file,
String s) |
static void |
append(File file,
String s,
String charset) |
static void |
append(String file,
byte[] bs) |
static void |
append(String file,
byte[] bs,
int off,
int len) |
static void |
append(String file,
long offset,
byte[] bytes) |
static void |
append(String file,
long offset,
byte[] bytes,
int off,
int len) |
static void |
append(String file,
String s) |
static void |
append(String file,
String s,
String charset)
拼接到文件最后一行
|
static void |
appendFast(File file,
byte[] bs) |
static void |
appendFast(File file,
byte[] bs,
int off,
int len) |
static void |
appendFast(File file,
InputStream in) |
static void |
appendFast(File file,
InputStream in,
boolean autoClose) |
static void |
appendFast(Path file,
byte[] bs) |
static void |
appendFast(Path file,
byte[] bs,
int off,
int len)
拼接
|
static void |
appendFast(Path file,
InputStream in) |
static void |
appendFast(Path file,
InputStream in,
boolean autoClose) |
static void |
appendFast(String file,
byte[] bs) |
static void |
appendFast(String file,
byte[] bs,
int off,
int len) |
static void |
appendFast(String file,
InputStream in) |
static void |
appendFast(String file,
InputStream in,
boolean autoClose) |
static void |
appendLines(File file,
long offset,
List<String> lines,
String charset)
拼接行到偏移处 尾行拼接\n
|
static void |
replace(File file,
int rangeStart,
int rangeEnd,
byte[] bytes) |
static void |
replace(File file,
int rangeStart,
int rangeEnd,
byte[] bytes,
int off,
int len)
写入到文件
|
static void |
replace(String file,
int rangeStart,
int rangeEnd,
byte[] bytes) |
static void |
replace(String file,
int rangeStart,
int rangeEnd,
byte[] bytes,
int off,
int len) |
static void |
write(File file,
byte[] bs) |
static void |
write(File file,
byte[] bs,
int off,
int len)
写入到文件
|
static void |
write(File file,
int skipBytes,
byte[] bs) |
static void |
write(File file,
int skipBytes,
byte[] bs,
int off,
int len)
写入到文件
|
static void |
write(File file,
String s) |
static void |
write(File file,
String s,
String charset) |
static void |
write(String file,
byte[] bs) |
static void |
write(String file,
byte[] bs,
int off,
int len) |
static void |
write(String file,
int skipBytes,
byte[] bs) |
static void |
write(String file,
int skipBytes,
byte[] bs,
int off,
int len) |
static void |
write(String file,
String s) |
static void |
write(String file,
String s,
String charset)
写入到文件
|
static void |
writeFast(File file,
byte[] bs) |
static void |
writeFast(File file,
byte[] bs,
int off,
int len) |
static void |
writeFast(File file,
InputStream in) |
static void |
writeFast(File file,
InputStream in,
boolean autoClose) |
static void |
writeFast(Path file,
byte[] bs) |
static void |
writeFast(Path file,
byte[] bs,
int off,
int len)
写入
|
static void |
writeFast(Path file,
InputStream in) |
static void |
writeFast(Path file,
InputStream in,
boolean autoClose) |
static void |
writeFast(String file,
byte[] bs) |
static void |
writeFast(String file,
byte[] bs,
int off,
int len) |
static void |
writeFast(String file,
InputStream in) |
static void |
writeFast(String file,
InputStream in,
boolean autoClose) |
static void |
writeToFile(File file,
int len,
File targetFile) |
static void |
writeToFile(File file,
long off,
File targetFile) |
static void |
writeToFile(File file,
long off,
int len,
File targetFile)
写入文件到文件
|
public static void append(File file, byte[] bs)
public static void append(String file, byte[] bs)
public static void append(String file, byte[] bs, int off, int len)
public static void append(File file, byte[] bs, int off, int len)
file
- 文件bs
- bytesoff
- offsetlen
- lengthpublic static void append(String file, String s, String charset)
file
- 文件s
- stringcharset
- 编码格式public static void append(String file, long offset, byte[] bytes)
public static void append(File file, long offset, byte[] bytes)
public static void append(String file, long offset, byte[] bytes, int off, int len)
public static void append(File file, long offset, byte[] bytes, int off, int len)
file
- 文件offset
- 起始偏移量bytes
- bytesoff
- 偏移量len
- 长度public static void appendLines(File file, long offset, List<String> lines, String charset)
file
- 文件offset
- 拼接偏移量lines
- 行charset
- 编码格式public static void write(File file, byte[] bs)
public static void write(String file, byte[] bs)
public static void write(String file, byte[] bs, int off, int len)
public static void write(File file, byte[] bs, int off, int len)
file
- 文件bs
- bytesoff
- offsetlen
- lengthpublic static void write(String file, String s, String charset)
file
- 文件s
- stringcharset
- 编码格式public static void write(String file, int skipBytes, byte[] bs)
public static void write(File file, int skipBytes, byte[] bs)
public static void write(String file, int skipBytes, byte[] bs, int off, int len)
public static void write(File file, int skipBytes, byte[] bs, int off, int len)
file
- 文件skipBytes
- 跳过前几位bs
- 写入数组off
- 偏移量len
- 写入长度public static void replace(String file, int rangeStart, int rangeEnd, byte[] bytes)
public static void replace(File file, int rangeStart, int rangeEnd, byte[] bytes)
public static void replace(String file, int rangeStart, int rangeEnd, byte[] bytes, int off, int len)
public static void replace(File file, int rangeStart, int rangeEnd, byte[] bytes, int off, int len)
file
- 文件rangeStart
- 写入指定区域开始rangeEnd
- 写入指定区域结束bytes
- 数据off
- 偏移量len
- 长度public static void writeToFile(File file, long off, int len, File targetFile)
file
- 文件off
- 文件偏移量len
- 写入长度targetFile
- 目标文件public static void writeFast(String file, byte[] bs)
public static void writeFast(File file, byte[] bs)
public static void writeFast(Path file, byte[] bs)
public static void writeFast(String file, byte[] bs, int off, int len)
public static void writeFast(File file, byte[] bs, int off, int len)
public static void writeFast(Path file, byte[] bs, int off, int len)
file
- fileoff
- offsetlen
- lenbs
- bspublic static void writeFast(String file, InputStream in)
public static void writeFast(File file, InputStream in)
public static void writeFast(Path file, InputStream in)
public static void writeFast(String file, InputStream in, boolean autoClose)
public static void writeFast(File file, InputStream in, boolean autoClose)
public static void writeFast(Path file, InputStream in, boolean autoClose)
public static void appendFast(String file, byte[] bs)
public static void appendFast(File file, byte[] bs)
public static void appendFast(Path file, byte[] bs)
public static void appendFast(String file, byte[] bs, int off, int len)
public static void appendFast(File file, byte[] bs, int off, int len)
public static void appendFast(Path file, byte[] bs, int off, int len)
file
- fileoff
- offsetlen
- lenbs
- bspublic static void appendFast(String file, InputStream in)
public static void appendFast(File file, InputStream in)
public static void appendFast(Path file, InputStream in)
public static void appendFast(String file, InputStream in, boolean autoClose)
public static void appendFast(File file, InputStream in, boolean autoClose)
public static void appendFast(Path file, InputStream in, boolean autoClose)
Copyright © 2024. All rights reserved.