Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Compressed Byte array to String convertion Problem

807589Oct 1 2008 — edited Oct 2 2008
Hello
I have to compress a string to a smaller string.
To do this i use Deflater as my compression tools. And it works well. But it return a byte array.
I try to display the byte array into a meaningfull string using new String(byte array) But it did't work.
Then i tried to encode the byte array using Base64 encoding,some thing like--

String comp=new sun.misc.BASE64Encoder().encode(byte array);

Now i found the displayable string. But the problem is it's length is some time more then the Original String that has to be compressed.
So can any one help me to conver that byte array to it's equal sized sting ?

Good byte
Nipo.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 30 2008
Added on Oct 1 2008
4 comments
383 views