package com.filestream;
import java.io.*;import javax.imageio.stream.FileImageInputStream;
public class FileStreamTest { /**
* @param args
*/
public static void main(String[] args){
// TODO Auto-generated method stub
File f = new File("new.txt");
try{
FileOutputStream fos = new FileOutputStream(f); //输出流
byte[] bu = "www.baidu.com".getBytes();
fos.write(bu);
fos.close();
FileInputStream fis = new FileInputStream(f); //输入流.
byte[] buf = new byte[1024];
int len = fis.read();
System.out.println(new String(buf,0,len));
}catch(Exception e){
e.printStackTrace();
}
}}
警告说:The import javax.imageio.stream.FileImageInputStream is never used
这是我用eclipse运行的,“console”那里没有什么结果,我查看我磁盘目录,有生成“new.txt”和相关的字符串,但是偶尔运行,请问高手这是怎么情况么?
import java.io.*;import javax.imageio.stream.FileImageInputStream;
public class FileStreamTest { /**
* @param args
*/
public static void main(String[] args){
// TODO Auto-generated method stub
File f = new File("new.txt");
try{
FileOutputStream fos = new FileOutputStream(f); //输出流
byte[] bu = "www.baidu.com".getBytes();
fos.write(bu);
fos.close();
FileInputStream fis = new FileInputStream(f); //输入流.
byte[] buf = new byte[1024];
int len = fis.read();
System.out.println(new String(buf,0,len));
}catch(Exception e){
e.printStackTrace();
}
}}
警告说:The import javax.imageio.stream.FileImageInputStream is never used
这是我用eclipse运行的,“console”那里没有什么结果,我查看我磁盘目录,有生成“new.txt”和相关的字符串,但是偶尔运行,请问高手这是怎么情况么?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货