import java.io.*; public class Andmeproov4{ public static void main(String[] arg) throws IOException{ OutputStream fos=new ByteArrayOutputStream(); DataOutputStream dos=new DataOutputStream(fos); dos.writeDouble(185.37); dos.close(); byte[] bm=((ByteArrayOutputStream)fos).toByteArray(); System.out.println(bm.length); InputStream fis=new ByteArrayInputStream(bm); DataInputStream dis=new DataInputStream(fis); System.out.println(dis.readDouble()); dis.close(); } }