package File;
import java.io.*;
public class FileOutDemo {
public static void main(String[] args) throws IOException {
/* FileOutputStream fo=null;
try {
fo = new FileOutputStream("guoqing0308.txt");
fo.write("abcdef".getBytes());
fo.write("\n".getBytes());
fo.write("abcde".getBytes());
}
catch(Exception e ) {
e.printStackTrace();
}
finally {
fo.close();
}*/
/* FileInputStream fi = new FileInputStream("guoqing0308.txt");
int by;
while((by=fi.read())!=-1){
System.out.print((char)(by));
}*/
/* System.out.println((char)(by));
by =fi.read();
System.out.println((char)(by));
by =fi.read();
System.out.println((char)(by));
by =fi.read();
System.out.println((char)(by));
by =fi.read();
System.out.println((char)(by));
by =fi.read();
System.out.println((char)(by));
by =fi.read();
System.out.println((char)(by));
by =fi.read();
System.out.println((by));*/
/*fi.close();*/
//FileInputStream fi =new FileInputStream("guoqing0308.txt");
/* FileOutputStream fo =new FileOutputStream( "boss.txt");
BufferedOutputStream bu =new BufferedOutputStream(fo);
bu.write("hello".getBytes());
bu.write("java".getBytes());
bu.close();*/
/* int by ;
while((by = fi.read()) !=-1){
fo.write(by);
}
fi.close();
fo.close();*/
/* byte [] bys =new byte[1024];
int len = 0;
while((len = fi.read(bys))!=-1 ){
System.out.println(len);
System.out.println( new String(bys,0,len));*/
FileInputStream fo =new FileInputStream("guoqing0308.txt");
BufferedInputStream buff =new BufferedInputStream(fo);
/* int by ;
while(( by=buff.read()) !=-1){
System.out.print((char)(by));
};*/
byte [] bys=new byte[1024];
int len;
while((len=buff.read(bys))!=-1){
System.out.println( new String(bys,0,len));
}
}
}