• Post Reply Bookmark Topic Watch Topic
  • New Topic

can't store compressed byte array as string  RSS feed

 
Jay Latrans
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found sample code to compress a string as a byte array and then decompress back into a string. Seems simple enough. I want to take the compressed byte array and store it as a string and then take the string and decompress it back into the original string. I believe the 'as string byte[]' should display the same thing as the 'compressed input' but I'm doing something wrong. I've tried ENC as "UTF-8" and a few others. Anyone able to make this work? Or is there a better way? Thanks in advance

 
Jay Latrans
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Silly me. I gather from a little more surfing that bytes are binary and Strings are characters and you can't really go from one to the other when the bytes really aren't characters. If you know better please let me know.
Thanks
 
Jay Latrans
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it can be done using A Base64 Encoder/Decoder. My goal was to obtain a string of compressed data that would be smaller than the original string but if i use the encoder/decoder my 'compressed' string is much larger than the original.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!