• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Binary to Ascii converter in Java?

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

Is there any option available in java to convert a binary file to ascii file? Any help is greatly appreciated.

regards,
prasanth
 
Marshal
Posts: 25682
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not in general. You'd have to have some rules about how the conversion was supposed to work. For example if I had a file containing six binary 00 bytes, what would you expect as the "ASCII equivalent" of that?

Once you have some rules in mind, it may be easier to find products that implement those rules.
 
Prasanth Pillai
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the response. I was under the assumption that its a generalized one. Because I see many tools available in the internet for this convertion. So I was wondering whether is there any such tool which can be integrated with a java code?
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you point us to a tool somewhere on the Internet which does this conversion, perhaps we could look at it and thus learn what it is you really want to do. But as Paul said, gently, there is no such thing as a generic binary-to-ASCII conversion -- the concept simply doesn't make any sense.
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
both binary files and text files contains bytes only.So if you binary file contains valid ascii bytes ,then you try to open the file using any ascii editor.
I could not get properly what you mean by converting binary to ascii?
 
Something must be done about this. Let's start by reading this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic