/*file f=new File ();
*
* File F=new file ("E:\\a.txt");
F.exists ();//judgment exists not
F.mkdirs ();//Create
F.getpath ();//Get relative path
F.delete ()//delete
F.listfiles (filter);//File array
F.list ();//array of strings for all subdirectories under the file
--------------------------------------------------------------------------------------
Flow
*
*
*
*
*
*
* Create file: Create a time to judge, if not saved directly to create (destination source write)
* File F=new file ("D:\\io");
if (f.exists ()) {
F.mkdirs ();
}
*
*
*
*
* Byte stream:
* FileInputStream f=new FileInputStream ("E:\\a.txt");
FileOutputStream fo=new FileOutputStream ("e:\\");
* Byte buffers:
*
Bufferedinputstream in=new Bufferedinputstream (in parentheses);
Bufferedoutputstream out=new Bufferedoutputstream (in parentheses);
*
*
* Character Stream:
* FileWriter fw=new FileWriter ("D;\\a.txt");
FileReader fr=new FileReader ("D;\\a.txt");
*
* Character buffers
* BufferedReader buff=new BufferedReader (in parentheses);
BufferedWriter buffe=new BufferedWriter ();
Custom buffers:
Buffer of Byte[]b=new byte[1024*1024];//1m
*
* Byte and Character conversions:
* InputStreamReader reader=new InputStreamReader ();//convert byte read stream to character read flow
*
OutputStreamWriter writ =new outputstreamwriter ()//convert byte read stream to character read flow
* Keyboard read:
* Keyboard input is the character, system.in. Need to be placed in the character conversion stream
* Same System.out Also
*
Read and Write
* Idea: Read the source file first. Write it when you're done reading
* Read and write on the side
* Split file ideas:
* Main Yes by custom buffer size to cut files
* (******) is mainly to write out the flow definition to while ()
*
*
FileInputStream file=new FileInputStream (New file ("E:\\id3.mp3"));//Read source
Byte[]b=new byte[1024*1024];//Custom Buffer size
int len=0;
File F=new file ("D:\\MP7");//Create Folder
if (f.exists ()) {
F.mkdirs ();
}
int count=1;
FileOutputStream Out=null;
while ((Len=file.read (b))!=-1) {
Out=new FileOutputStream (New File (F, (count++) + ". mp3"));//cycle produces one flow at a time
Out.write (B,0,len);
}
Out.close ();//Mathematic
File.close ();
*------------------Important------------------------------------------of *********--
* This allows you to read or write, and then write the configuration file when splitting:
* Used to set
*
* Properties PPS = new properties ();
*
* is often related to writing configuration files,
* Directly load into the output stream to write out
* Pps.setproperty (key, value), key-value pair form exists.
*
* Pps.load (instream);//download it from the stream
* Pps.store (output stream, first name);//Load to Collection
*
*
*
2016/05/13 Day Finishing:
Learning is not a task! Like IS dry!!! Do not like also to do!!
* */
CN finishing IO Fundamentals