java io流 数据流传输
把这段当公式用就可以了
//数据流传输 import java.io.*; public class Index{ public static void main(String[] args) throws Exception{ //把这段当公式用就可以了 //不用记忆 ByteArrayOutputStream zjszl = new ByteArrayOutputStream(); DataOutputStream sjl = new DataOutputStream(zjszl); long aa = 123456789; sjl.writeLong(aa); byte[] zjsz = zjszl.toByteArray(); ByteArrayInputStream srl = new ByteArrayInputStream(zjsz); DataInputStream sjsr = new DataInputStream(srl); long ss; ss = sjsr.readLong(); System.out.println("ss="+ss); } }