protected override ConstantExpression DecodeTyped(ExpressionType expressionType, ref byte *data, ref int remainingBytes, bool doNotCheckBounds)
        {
            var type       = typeCodec.Decode(ref data, ref remainingBytes, doNotCheckBounds);
            var valueCodec = CodecContainer.GetAbstractManualCodecFor(type);
            var value      = valueCodec.Decode(ref data, ref remainingBytes, doNotCheckBounds);

            return(Expression.Constant(value, type));
        }
        protected override void EncodeTyped(ref byte *data, ConstantExpression expression)
        {
            var type       = expression.Type;
            var valueCodec = CodecContainer.GetAbstractManualCodecFor(type);

            typeCodec.Encode(ref data, type);
            valueCodec.Encode(ref data, expression.Value);
        }
        protected override int CalculateSizeTyped(ConstantExpression expression)
        {
            var type       = expression.Type;
            var valueCodec = CodecContainer.GetAbstractManualCodecFor(type);

            int result = 0;

            result += typeCodec.CalculateSize(type);
            result += valueCodec.CalculateSize(expression.Value);
            return(result);
        }
示例#4
0
        // Containers go here

        public BitmovinApi(string apiKey, string apiUrl = "https://api.bitmovin.com/v1/")
        {
            ApiKey      = apiKey;
            _apiUrl     = apiUrl;
            _restClient = new RestClient(apiKey, apiUrl);

            this.Input     = new InputContainer(_restClient);
            this.Output    = new OutputContainer(_restClient);
            this.Codec     = new CodecContainer(_restClient);
            this.Encoding  = new EncodingContainer(_restClient);
            this.Manifest  = new ManifestContainer(_restClient);
            this.Statistic = new StatisticContainer(_restClient);
        }
 public void Setup()
 {
     codecContainer = new CodecContainer();
 }
示例#6
0
 public void Setup()
 {
     codecContainer = new CodecContainer();
 }