• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

binary file to text file

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Rancher
Posts: 5035
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Squanch that. And squanch this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic