【004】2020.11.03 周二 --《Java数据的输入输

2020-11-04  本文已影响0人  幸福布道者
数据库的输入输出处理

File类

问题01:创建File类的三种方式

回答01:

    1)File file = new File("/tmp/filename")

    2)File file = new File(String parent, String child)

    3)File file = new File(File parent, String child)

问题02:常用方法有哪些?

回答02:getName()exists()mkdir()

字节输入输出流

InputStream类

    定义:字节输入流的抽象类,是所有字节输入流的父类

    常用方法

        void mark( int readLimit)

        int read()

        int read(byte[] bytes, int offer, int length)

        void reset()

OutputStream类

    void flush()

    void write(int ib)

    void write(byte[] bytes)

    void write(byte[] bytes, int offer, int length)

FileInputStream类

FileOutputStream类

BufferedInputStream类

BufferedOutputStream类

DataInputStream类

DataOutputStream类

上一篇 下一篇

猜你喜欢

热点阅读