标签:std input ati close print inpu OLE 数据 random
import java.io.*; import java.util.*; public class TestDataOutputStream{ public static void main(String[] args){ try{ ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); dos.writeDouble(Math.random()); dos.writeBoolean(false); dos.flush(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); DataInputStream dis = new DataInputStream(bais); System.out.println(dis.readDouble()); System.out.println(dis.readBoolean()); dos.close(); dis.close(); } catch(IOException e){ e.printStackTrace(); } } }
标签:std input ati close print inpu OLE 数据 random
原文地址:https://www.cnblogs.com/yxfyg/p/12400821.html