DataStream
Data
DataInputStream
数据输入流允许应用程序以与机器无关方式从底层输入流中读取基本
DataInputStream dis = new DataInputStream(InputStream in);
另一种创建方式是接收一个字节数组,和两个整形变量
序号 | 方法描述 |
---|---|
1 | len 个字节读入一个字节数组中。如果 |
2 | b 中。 |
3 | |
4 |
import java.io.*;
public class Test{
public static void main(String args[])throws IOException{
DataInputStream in = new DataInputStream(new FileInputStream("test.txt"));
DataOutputStream out = new DataOutputStream(new FileOutputStream("test1.txt"));
BufferedReader d = new BufferedReader(new InputStreamReader(in));
String count;
while((count = d.readLine()) != null){
String u = count.toUpperCase();
System.out.println(u);
out.writeBytes(u + " ,");
}
d.close();
out.close();
}
}