1. 抽象基类InputStream、OutputStream,不能实例化。
• InputStream类是基本的输入类。它定义了所有输入流所需的方法。
• publicabstract int read() throws IOException
• publicint read(byte b[]) throws IOException
• public int read(byte b[],intoffset,int length) throws IOException
功能为从输入流中读数据。这一方法有几种重载形式,可以读一个字节或一组字节。当遇到文件尾时,返回-1。最后一种形式中的offset是指把结果放在b[]中从第offset个字节开始的空间,length为长度。
• public int available() throwsIOException
输入流共有多少字节可读。注意此方法对InputStream的各派生类不一定都有效,有时会有返回零字节的错误结果。
• public void close() throwsIOException
关闭输入流并释放资源。虽然java提供垃圾回收机制,当一个流不再使用时可以由运行系统自动关闭,但为了提高程序的安全性和稳定性,建议使用close()关闭。
• public boolean markSupperted( )
返回布尔值,说明此流能否做标记或复位。
• public synchronized void mark(intreadlimit)
为当前流做标记。其参数说明在标记失效前可以读多少字节,这个值通常也就设定了流的缓冲区大小。
• public synchronized void reset()throws IOException
返回到上一次做标记处。
• public long skip (long n) throwsIOEnception
从输入流跳过几个字节。返回值为实际跳过的字节数
2.
PublicFileOutputStream(String name)throws FileNotFoundException
PublicFileOutputStream(File file)throws FileNotFoundExcept