Thought it will be simple but no....
c#
Code: Select all
public static byte[] CompressToBytes (string text) {
byte[] raw = Encoding.UTF8.GetBytes(text);
using (MemoryStream memory = new MemoryStream()) {
using (GZipStream gzip = new GZipStream(memory, CompressionMode.Compress, true)) {
gzip.Write(raw, 0, raw.Length);
}
return memory.ToArray();
}
}
...
ob.PutByteArray("D", CompressToBytes(SomeLongString));
...
But it says that can't convert byte[] to ByteArray
What kind of ByteArray sfs expects in that case ?