//cualquiera de las dos funciones de comprimir causa un leak de memoria enorme
public static int ComprimirBuffer(byte[] in_buffer,ref byte[] out_buffer)
{
out_buffer=new byte[in_buffer.Length+300];
Deflater compresor=new Deflater();
compresor.SetInput(in_buffer);
compresor.Flush();
compresor.Finish();
int compressedsize=compresor.Deflate(out_buffer,0,(int)(in_buffer.Length)+300);
compresor=null;
return compressedsize;
}