December 9, 2016.
Today,the teacher has a problem .it involves all the knowledge before,i don't seemto know exactly how to do it ,but the problem is that that the knowledge is learned knowledge, i estimate that my previous knowledge is not strong enough,Usually go back after the real night to 1 am.
Now say that the hard work, the future can not see hope, then the road so far, how to do?
现在就说辛苦叫累,对未来看不到希望,那以后的路还那么远那该怎么办??
NOTES
//字符流不可用于操作图片 视频 音乐等文件
package testfileinput;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
public class TestBuffered {
public static void main(String[] args) throws Exception {
FileOutputStream fos=new FileOutputStream("D:/12.jpg"); //写
FileInputStream fis=new FileInputStream("F:/12.jpg"); //读
BufferedOutputStream bos=new BufferedOutputStream(fos);
//写
BufferedInputStream bis=new BufferedInputStream(fis); //读
byte[] b=new byte[1024];
int a;
while((a=bis.read(b))!=-1){
bos.write(b, 0, a);
}
bos.close();
bis.close();
}
}
package file;
import java.io.File;//打印指定目录下的所有文件 包括文件夹里面的文件
public class hw_bianli_wj {
public static void getAllfiles(String path){
File file=new File(path);
//判断是否一个文件夹
if(file.isDirectory()){
//获取文件夹下的所有文件对象
File[] files=file.listFiles();
for (File fileson : files) {
if(fileson.isDirectory()){
//是文件 则调用自身
getAllfiles(fileson.getAbsolutePath());
}else{
System.out.println(fileson.getAbsolutePath());
}
}
}else{
System.out.println("这不是一个标准路径");
}
}
public static void main(String[] args) {
getAllfiles("F:/电视剧");
}
}
This is notes, is also a life, and grow。