aspose file tools*
The moose likes Java in General and the fly likes converting from binary to ascii Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "converting from binary to ascii" Watch "converting from binary to ascii" New topic
Author

converting from binary to ascii

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
Does anyone know of an algorithm to convert a .pcx file, which is a binary
file, to ascii?

Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39541
    
  27
Anything binary can be converted (reversibly) to ASCII by the Base64 encoding. One of the libraries that implements it is Jakarta Commons Codec. Understand, though, that no image-specific operations can be performed on that ASCII representation until it is decoded back to binary.
[ January 04, 2007: Message edited by: Ulf Dittmer ]

Ping & DNS - updated with new look and Ping home screen widget
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
can try apaches commons codec package.


Rahul Bhattacharjee
LinkedIn - Blog
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18103
    
  39

Base64 encoding (and decoding) is actually built into the JVM core classes -- via the sun.misc.BASE64Encoder and sun.misc.BASE64Decoder classes.

Interestingly, these classes have come into "common" usage to the point that they are also built into the IBM JVM as well. (with the same package and class names)

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Lucas Lee
Ranch Hand

Joined: Oct 02, 2006
Posts: 53
Use Base64 or other similar encoding algorithm.
But you need pay attention to that encoding will enlarge the file size to 1.33 times.
 
 
subject: converting from binary to ascii
 
Similar Threads
FTP upload
Binary to Ascii converter in Java?
pdf getting corrupted while transfering through FTP
Checking if a file is binary/ascii in Java
Reading image and convert it to Base64 format