Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

write binary 'b' to file using DataOutputStream  RSS feed

 
Florence Cheung
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,all,
I am trying to write binary 'b' to file using the following code:
FileOutputStream fout=new FileOutputStream("xxx.txt");
DataOutputStream dout=new DataOutputStream(fout);
dout.write((byte)'b');
I tried this at one computer(Dell,Windows 98 OS),'b' was written.But at the other computer(Dell,Windows professional 2000 OS),0 was written.
Anybody know why?Isn't it platform-independent?
Thanks in advance!
Florence
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!