| 限定符和类型 | 类和说明 |
|---|---|
static class |
FileSystemProducer.FILEENCODE |
| 构造器和说明 |
|---|
FileSystemProducer(String location) |
FileSystemProducer(String location,
boolean binary) |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
contentLength()
文件长度: 字节, 回车(即\r\n)为2字节
Ansi 英文占1个字节,中文2个字节
Unicode 每个字符(中文、英文)都占2个字节
UTF8 是 Unicode一种压缩形式,UTF8把英文压缩成1个字节,中文占3个字节,另外有固定3个字节的头
|
static void |
copy_byte_file(String source,
String target) |
static void |
copy_char_file(String source,
String target) |
static void |
copy_char_file(String source,
String target,
String charset,
int size) |
FileSystemProducer.FILEENCODE |
encode()
文件编码, Ascii文件
UTF-8: EF BB BF, -17 -69 -65
|
long |
lastModified() |
long |
linenum()
计算文件行数: \r 0D, \n 0A
跟踪行号的缓冲字符输入流。
|
static byte[] |
produce_bytes(InputStream is) |
static byte[] |
produce_bytes(InputStream is,
IFileProgressListener listener) |
static void |
produce_file(byte[] data,
String filepath) |
static void |
produce_file(InputStream is,
String filepath) |
static void |
produce_file(InputStream is,
String filepath,
IFileProgressListener listener) |
static String |
produce_string(InputStream is) |
static String |
produce_string(InputStream is,
String linesep,
String charset) |
static String |
produce_string(String filepath,
int size) |
static String |
produce_string(String filepath,
String linesep,
String charset,
int size) |
int |
produce(File file) |
InputStream |
stream() |
public FileSystemProducer(String location)
public FileSystemProducer(String location, boolean binary)
public long contentLength()
throws IOException
contentLength 在接口中 IProducerIOException - 读写错误public long lastModified()
throws IOException
lastModified 在接口中 IProducerIOExceptionpublic InputStream stream() throws IOException
stream 在接口中 IProducerIOExceptionpublic int produce(File file) throws IOException
produce 在接口中 IProducerIOExceptionpublic FileSystemProducer.FILEENCODE encode() throws IOException
IOException - 读写错误public long linenum()
throws IOException
IOException - 读写错误public static String produce_string(InputStream is)
public static String produce_string(InputStream is, String linesep, String charset)
public static String produce_string(String filepath, String linesep, String charset, int size)
public static byte[] produce_bytes(InputStream is)
public static byte[] produce_bytes(InputStream is, IFileProgressListener listener)
public static void produce_file(InputStream is, String filepath)
public static void produce_file(InputStream is, String filepath, IFileProgressListener listener)
public static void produce_file(byte[] data,
String filepath)
public static void copy_char_file(String source, String target, String charset, int size)
Copyright (c) 2002-2020 Luther Inc.