确定写入DataOutputStream的字节数
/** 来 自 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//NumberOfBytes.txt"; try { //create FileOutputStream object FileOutputStream fos = new FileOutputStream(strFilePath); DataOutputStream dos = new DataOutputStream(fos); String str = "Example to show number of bytes written to stream"; dos.writeBytes(str); int bytesWritten = dos.size();/** from 时 代 J a v a**/ System.out.println("Total " + bytesWritten +