15.DataOutputStream

发表日期:2022-08-05 16:20:31 | 来源: | | 浏览(980) 分类:JAVA基础

OutputDemo01

import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;


public class OutputDemo01 {

   /**
    * @param args
    * @throws IOException 
    */
   public static void main(String[] args) throws IOException {
      // TODO Auto-generated method stub
      File file = new File("d:"+File.separator+"test.txt");
      
      FileOutputStream os = new FileOutputStream(file);

      DataOutputStream dos = new DataOutputStream(os);
      
      int arg = 123;
      
      dos.writeInt(arg);
      
   }

}


集速网 copyRight © 2015-2025 宁ICP备15000399号-1 宁公网安备 64010402001209号
与其临渊羡鱼,不如退而结网
欢迎转载、分享、引用、推荐、收藏。