Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

converting from binary to ascii

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know of an algorithm to convert a .pcx file, which is a binary
file, to ascii?

Thanks.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can try apaches commons codec package.
 
Henry Wong
author
Marshal
Pie
Posts: 21119
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Lucas Lee
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Base64 or other similar encoding algorithm.
But you need pay attention to that encoding will enlarge the file size to 1.33 times.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic