DataOutputStream 用 writeChars() 写入文件的字符串怎么读出来

DataOutputStream out = new DataOutputStream(new FileOutputStream(filename));

out.writeChars("中国");

这个数据怎么读出来。( 像int型的有readInt() )

横空hero
浏览 2339回答 3
3回答

慕粉3342523

char c = '\0';while ((c = inData.readChar()) != '\0') {System.out.print(c);}

慕粉3291149

char c = '\0'; while ((c = inData.readChar()) != '\0') { System.out.print(c); }
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java