Forums Register Login

converting from binary to ascii

+Pie Number of slices to send: Send
Does anyone know of an algorithm to convert a .pcx file, which is a binary
file, to ascii?

Thanks.
+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
can try apaches commons codec package.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Use Base64 or other similar encoding algorithm.
But you need pay attention to that encoding will enlarge the file size to 1.33 times.
These are the worst of times and these are the best of times. And this is the best tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1007 times.
Similar Threads
Checking if a file is binary/ascii in Java
FTP upload
pdf getting corrupted while transfering through FTP
Reading image and convert it to Base64 format
Binary to Ascii converter in Java?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:33:23.