Learning Java IO indexes

  I/O Streams, it simplifies I/O operations, write a whole object out to stream & read back. File I/O and file system operations, including random access files.

  Classes about I/O Streams most are in java.io, about File I/O are in java.nio.file.

 I/O Streams:

  • Byte Streams: raw binary data
  • Character Streams: character data, auto translation from/to local charset
  • Buffered  Streams: opt I/O by reducing calls to native API
  • Scanning and Formatting: read/write formattedly
  • I/O from the Command Line
  • Data Streams: binary I/O of primitive data type & String Values
  • Object Streams: binary I/O of objects

File I/O (Featuring NIO.2)

  • What is a Path?: tells concept of a path in a given OS
  • The Path Class: intro of the cornerstorne class of package java.nio.file
  • Path Operations: intro to methods of Path class
  • File Operations: intro to concepts common to many of the file i/o methods
  • Checking a File or Directory: methods to check file existence & accessibility
  • Delete/Copy/Move a File/Directory: intros to methods
  • Managing Metadata: methods to read/set file attributes
  • Reading, Writing, Creating Files: stream/channel methods for r/w files
  • Random Access Files: method to r/w file in a non-sequentially manner
  • Creating/Reading Dir: API of dirs, such as ls/dir/mkdir in shell
  • Links, Symbolic or Otherwise: methods of symbolics/hard links
  • Waling the File Tree: methods behaves like for /r in cmd
  • Finding Files: use pattern matching to search for files
  • Watching a Dir for Changes: how to use watch service to detect files adding/removing/updating in 1 or more dirs
  • Other Useful Methods: APIs not mentioned
  • Legacy File I/O Code: .. to update from legacy java.io.File class, a table mapping java.io.File to java.nio.file provided

 

posted on 2016-04-11 16:55  三叁  阅读(144)  评论(0编辑  收藏  举报

导航