FileStream

Overview

FileStream 是一个类在Java的FOSS中. 继承人: Stream.

文件流用于读取和写入文件.

本类提供了16种方法,用于在Java程序中使用FileStream 对象. 有的方法包括: FileStream, Stream, close, flush, getInputStream, getLength, getOutputStream, read, readByte, seek, setLength, write,其他方法. 所有公众成员在安装了Java的FOSS包后,可以访问任何 Java应用程序. 特性: APPEND, CREATE, OPEN, READ, READ_WRITE, WRITE,另外还有3个.

Properties

NameTypeAccessDescription
lengthlongRead得到文件的长度.
CREATEintRead得到了创造.
OPENintRead得到了开放.
APPENDintRead得到了附带.
READintRead得到了读取.
WRITEintRead得到了写作.
READ_WRITEintRead读写的东西.
outputStreamOutputStreamRead得到输出流.
inputStreamjava.io.InputStreamRead得到输入流.

Methods

SignatureDescription
FileStream(fileName: String, fileMode: int, fileAccess: int)创建一个新的文件流.
FileStream(fileName: String, fileMode: int)创建一个新的文件流.
getLength()long得到文件的长度.
setLength(len: long)设置文件的长度.
readByte()int读取文件中的一个字节.
read(buf: byte[])int读取文件中的字节.
read(buf: byte[], start: int, len: int)int读取文件中的字节.
write(buf: byte[])写字节到文件中.
write(buf: byte[], start: int, len: int)写字节到文件中.
writeByte(b: int)写一个字节到文件.
seek(offset: long, seek: int)long寻求在文件中的位置.
close()关闭文件流.
flush()清洗文件流.
Stream(in: InputStream)文件流用于读取和写入文件.
getOutputStream()OutputStream返回输出流.
getInputStream()java.io.InputStream创建一个新的文件流.

See Also

 中文