コード例 #1
0
        public BinaryGloutonHandler(BinaryGloutonHandlerConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            _file         = new MonitorBinaryFileOutput(configuration.Path, configuration.MaxCountPerFile, configuration.UseGzipCompression);
            _memoryStream = new MemoryStream();
            _binaryReader = new CKBinaryReader(_memoryStream, Encoding.UTF8, true);

            _configuration = configuration;
        }
コード例 #2
0
 public bool ApplyConfiguration(IGloutonHandlerConfiguration configuration)
 {
     if (!(configuration is BinaryGloutonHandlerConfiguration cF) || cF.Path != _configuration.Path)
     {
         return(false);
     }
     if (_configuration.UseGzipCompression != cF.UseGzipCompression)
     {
         _file.Close();
         _file = new MonitorBinaryFileOutput(_configuration.Path, _configuration.MaxCountPerFile, _configuration.UseGzipCompression);
     }
     else
     {
         _file.MaxCountPerFile = cF.MaxCountPerFile;
     }
     _configuration = cF;
     return(true);
 }