标签:tin ssi stat otf tor dde ESS void sep
package test; import java.io.*; import java.sql.SQLClientInfoException; import java.text.DateFormat; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.CountDownLatch; import java.util.zip.InflaterInputStream; import javax.annotation.processing.FilerException; import javax.management.RuntimeErrorException; import privateclass.Filterby_Name; import privateclass.Filterby_hidden; import privateclass.Filterby_java; import privateclass.MyBufferedReader; import privateclass.Person; public class Main { private static final String space_operator = " "; private static final double pi = Math.PI; private static final String LINE_SEPARATOR = System.getProperty("line.separator"); private static final int SIZE = 1024*1024; public static void main(String[] args) throws Exception { doswrite(); disread(); } public static void disread() throws FileNotFoundException, IOException { DataInputStream dis = new DataInputStream(new FileInputStream("data.txt")); String string = dis.readUTF(); int a = dis.readInt(); System.out.println(string); System.out.println(a); } public static void doswrite() throws FileNotFoundException, IOException { DataOutputStream dos = new DataOutputStream(new FileOutputStream("data.txt")); //这个utf开头会带有标识所以只能用类型流读出 dos.writeUTF("小朋友哥哥给你买糖吃"); dos.writeInt(99); } }
类型流DataInputstream 和DataOutputStream的用法
标签:tin ssi stat otf tor dde ESS void sep
原文地址:https://www.cnblogs.com/WINDZLY/p/11828661.html