ioioio

1424 단어 IO
try{
        BufferedReader in4 =new BufferedReader(new StringReader(s2)); // s2 
        PrintWriter out1 =new PrintWriter(new BufferedWriter(new FileWriter(\"F:epalon TestIO.out\")));
        int lineCount = 1;
        while((s = in4.readLine()) != null)
            out1.println(lineCount  + \":\" + s);
        out1.close();
        in4.close();
    }
    catch(EOFException ex){
        System.out.println(\"End of stream\");
    }

//5.  
    try{
        DataOutputStream out2 = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(\"F:epalon Data.txt\")));
        out2.writeDouble(3.1415926);
        out2.writeChars(" Thas was pi:writeChars ");
        out2.writeBytes( "Thas was pi:writeByte ");
        out2.close();
        DataInputStream in5 = new DataInputStream(new BufferedInputStream(new FileInputStream(\"F:epalon Data.txt\")));
        BufferedReader in5br = new BufferedReader(new InputStreamReader(in5));
        System.out.println(in5.readDouble());
        System.out.println(in5br.readLine());
        System.out.println(in5br.readLine());
    }
    catch(EOFException e){
        System.out.println(\"End of stream\");
    }


좋은 웹페이지 즐겨찾기