下载此文档

Java程序设计英文版课件:ch18 IO (InputOutput).ppt


文档分类:IT计算机 | 页数:约63页 举报非法文档有奖
1/63
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/63 下载此文档
文档列表 文档介绍
*
Chapter 18
I/O (Input/Output)
*
Introduction to I/O
Creating a good input/output (I/O) system is one of the more difficult tasks for a language designer. This is evidenced by the number of different approaches.
The challenge of I/O:
Different sources
Different sinks
Files, the console, network connections
Sequential, random-access, buffered, binary, character, by lines, by words
*
Introduction to I/O
Class File
I/O Stream
Input Streams/ Output Streams
Node Streams/ Processing Streams
File Streams/ Buffer Streams
Print Streams
Data Streams /Object Streams
RandomAccessFile
Compression
XML
*
Introduction to I/O
Sally
Black
Tom
Blue
Judy
Green
Iris
Orange
Randy
Red
Judy
Green
J u d y String
01001010 Byte
1 Bit
line
File
0
1
2
3
4
……
n-1
n
A file containing n Bytes
*
Introduction to I/O
Stream in Java I/O
In Java, the input and output of data are operated by “Stream”.
There are a lot of “Stream” in Java for different data types.
*
Class File
Introduction

represent either the name of a particular file or the names of a set of files in a directory.
Constructor summary of Class File
public File (String pathname)
  Creates a new File instance by converting the given pathname string into an abstract pathname.
public File(String parent, String child)
Creates a new File instance from a parent pathname string and a child pathname string.
*
Class File
Methods summary of class File
public boolean canRead()
public boolean canWrite()
public boolean exists()
public boolean isDirectory()
public boolean isFile()
public boolean isHidden()
public long lastModified()
public long length()
public String getName()
public String getPath()
*
Class File
Methods summary of class File
public boolean createNewFile() throws IOException
Atomically creates a new, empty file named by this abstract pathname if and only if a file with this name doe

Java程序设计英文版课件:ch18 IO (InputOutput) 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数63
  • 收藏数0 收藏
  • 顶次数0
  • 上传人窝窝爱蛋蛋
  • 文件大小788 KB
  • 时间2021-12-07
最近更新