Java 流框架 学习笔记
2024-07-15 11:32:57 0 举报
AI智能生成
登录查看完整内容
Java 流框架(InputStream,OutputStream,Reader,Writer)学习笔记
作者其他创作
大纲/内容
int read()
int read(byte[] b)
long skip(long n)
int available()
void close()
void mark(int readlimit)
boolean markSupported()
void reset()
方法
ByteArrayInputStream
FileInputStream
BufferedInputStream
int readInt()
long readLong()
short readShort()
byte readByte()
char readChar()
boolean readBoolean()
double readDouble()
float readFloat()
void readFully(byte[] b)
String readUTF()
int skipBytes(int n)
DataInputStream
GZIPInputStream
ZipEntry getNextEntry()
void closeEntry()
ZipInputStream
JarInputStream
FilterInputStream
StringBufferInputStream
Object readObject()
ObjectInputStream
子类
InputStream
void write( int n)
void write(byte[] b)
void flush()
ByteArrayOutputStream
FileOutputStream
BufferedOutputStream
void writeInt(int i)
void writeLong(long l)
void writeShort(int s)
void writeByte(int b)
void writeChar(int c)
void writeChars(String s)
void writeBoolean(boolean b)
void writeDouble(double d)
void writeFloat(float f)
void writeUTF(String s)
DataOutputStream
GZIPOutputStream
void putNextEntry(ZipEntry ze)
void setLevel(int level)
void setMethod(int method)
ZipOutputStream
JarOutputStream
FilterOutputStream
StringBufferOutputStream
void writeObject(Object o)
ObjectOutputStream
OutputStream
long getCrc()
String getName()
long getSize()
boolean isDirectory()
void setSize(long size)
void setCrc(long crc)
ZipEntry:Zip压缩包中的项
Enumeration entries():可以枚举这个ZIP文件中各个项ZipEntry的Enumeration对象
ZipEntry getEntry(String name)
InputStream getInputStream(ZipEntry entry)
String getName():返回这个ZIP文件的路径
ZipFile:Zip文件
读文件
写文件
示例
Zip文件相关类
字节流
LineNumberReader
BufferedReader
FileReader
InputStreamReader
StringReader
CharArrayReader
Reader
BufferedWriter
FileWriter
OutputStreamWriter
StringWriter
CharArrayWriter
Writer
字符流
static separator
boolean exists()
boolean mkdir()
boolean mkdirs()
boolean delete()
boolean renameTo(File dest)
boolean isFile()
boolean createNewFile()
String getPath()
String getAbsolutePath()
File getAbsoluteFile()
String getParent()
File getParentFile()
String[] list()
String[] list(FilenameFilter filter)
File[] listFiles()
File[] listFiles(FilenameFilter filter)
File
Paths
Path resolve(Path other)
Path resolve(String other)
Path resolveSibling(Path other)
Path resolveSibling(String other)
Path relatiivize(Path path)
Path normalize()
Path toAbsolutePath()
Path getParent()
Path getFileName()
Path getRoot()
File toFile()
Path
byte[] readAllBytes(Path path)
void delete(Path path)
void deleteIfExists(Path path)
boolean exists(Path path)
boolean isHidden(Path path)
boolean isReadable(Path path)
boolean isWriter(Path path)
boolean isExecutable(Path path)
boolean isDirectory(Path path)
boolean isRegularFile(Path path)
boolean isSymbolicLink(Path path)
long size(Path path)
DirectoryStream newDirectoryStream(Path path):获取给定上当中可以遍历所有文件和目录的迭代器
Files
文件类
Java 流框架
0 条评论
回复 删除
下一页