I need to send a string to a .Net program from a Java program.
I want to take a string from Java and compress it using GZIPOutputStream and decompress it with System.IO.Compression.GZipStream from .Net.
ByteArrayOutputStream out = new ByteArrayOutputStream();
try
{
GZIPOutputStream gzipOutputStream = new GZIPOutputStream(out);
gzipOutputStream.write(text.getBytes("utf-8"));
}
catch (IOException e)
{
//Something
}
return out.toByteArray();
Currently I have it so that it returns a byte[] from the Java Program. But is there a way to make byte[] into a String and send the string to .Net? and Be able to turn the String back to byte[] in .Net to decompress it back to a string?
What are my options here? My main goal is to send a compressed string to .Net program. Is that not possible with compressed?
Thanks.