集册 Java实例教程 冲洗输出流

冲洗输出流

欢马劈雪     最近更新时间:2020-01-02 10:19:05

628
冲洗输出流

 
 /**
  from
 * n o w  j a v a  . c o m 
 **/

import java.io.DataOutputStream;

import java.io.FileOutputStream;

import java.io.IOException;

 

 

public class Main {

 

  public static void main(String[] args) {

    String strFilePath = "C://Folder//WriteByte.txt";

   

    try{

       FileOutputStream fos = new FileOutputStream(strFilePath);/** 时 代 J a v a - nowjava.com 提 供 **/

       DataOutputStream dos = new DataOutputStream(fos);

       String strContent = "This example shows how to flush output stream!";

       dos.writeBytes(strContent);

       dos.flush();

 
展开阅读全文