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

binary file to text file  RSS feed

 
kumaraswamy adurthi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all,

i have file which is entirely in binary format containing 1's,0's i want this file is to convert as a text file using java . is it possible i can convert text file to binary file using java .
thank you all
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, welcome to the ranch! If you've been reading here you probably noticed that we often give hints instead of complete answers so you can enjoy some of the discovery process.

Snoop through the examples in Integer.parseInt( string, radix ) and see if you spot one that can change a set of 8 1s and 0s into an Integer. From there see if you can convert to a byte or a char. Should be fun!
[ September 27, 2005: Message edited by: Stan James ]
 
Norm Radder
Ranch Foreman
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you are asking. ALL data on a computer is binary.
Everything is in 8 bit bytes. How you interpret what is in a byte or group of bytes depends on the context.
Please explain some more, and/or give some example.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, yes, I made the leap that if you typed the input file you see only 1s and 0s. I may have lept right off the edge of the problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!