Esempio n. 1
0
        public static IParamContainer SetCompression(
            this IParamContainer pc,
            BinaryDataCompressionType compressionType)
        {
            switch (compressionType)
            {
            case BinaryDataCompressionType.NoCompression:
                return(pc.SetNoCompression());

            case BinaryDataCompressionType.ZLib:
                return(pc.SetZlibCompression());

            default:
                throw new NotSupportedException("Compression type not supported: " + compressionType.ToString());
            }
        }
Esempio n. 2
0
        public string EncodeBase64(double[] values, BinaryDataCompressionType compressionType, BinaryDataType binaryDataType)
        {
            memoryStream.Position = 0;
            switch (compressionType)
            {
            case BinaryDataCompressionType.NoCompression:
                NoCompression(memoryStream, binaryDataType, values);
                break;

            case BinaryDataCompressionType.ZLib:
                ZLib(memoryStream, binaryDataType, values);
                break;

            default:
                throw new NotSupportedException("Compression type not supported: " + compressionType.ToString());
            }
            memoryStream.Position = 0;
            return(Convert.ToBase64String(memoryStream.ToArray()));
        }