コード例 #1
0
        /// <inheritdoc/>
        public Guid RegisterStreamValueSubscriber <TTarget>(
            IStreamAdapter streamAdapter,
            RelativeTimeInterval epsilonTimeInterval,
            Action <bool, TTarget, DateTime, DateTime> callback)
        {
            var publisher = default(StreamValuePublisher <TSource, TTarget>);

            lock (this.publishers)
            {
                // Check if we have a publisher for this epsilon interval
                if (!this.publishers.ContainsKey(epsilonTimeInterval))
                {
                    this.publishers.Add(epsilonTimeInterval, new List <IStreamValuePublisher <TSource> >());
                }

                // Get the list of publishers for the specified epsilon interval
                var epsilonTimeIntervalPublishers = this.publishers[epsilonTimeInterval];

                // Check if we already have a publisher that uses the specified stream adapter
                publisher = epsilonTimeIntervalPublishers.FirstOrDefault(p => p.StreamAdapter.Equals(streamAdapter)) as StreamValuePublisher <TSource, TTarget>;
                if (publisher == null)
                {
                    // If not found, create a new publisher
                    publisher = new StreamValuePublisher <TSource, TTarget>(streamAdapter);
                    epsilonTimeIntervalPublishers.Add(publisher);
                }
            }

            // Register the subscriber with this publisher
            return(publisher.RegisterSubscriber(callback));
        }
コード例 #2
0
        /// <summary>
        /// Deserializes the Sphinx server response data on the provided stream and reconstitutes the graph of objects.
        /// </summary>
        /// <param name="stream">The stream that contains the data to deserialize.</param>
        /// <exception cref="ServerErrorException"/>
        /// <exception cref="SphinxException"/>
        /// <exception cref="IOException"/>
        internal protected override void Deserialize(IStreamAdapter stream)
        {
            IBinaryReader reader = Connection.FormatterFactory.CreateReader(stream);

            // read general command response header values
            Result.Status = (CommandStatus)reader.ReadInt16();
            short serverCommandVersion = reader.ReadInt16();

            // read response body length
            int length = reader.ReadInt32();

            if (length <= 0 || length > MaxCommandBodyLength)
            {
                throw new SphinxException(String.Format(Messages.Exception_InvalidServerResponseLength, length));
            }

            // read server response body
            byte[] buffer = new byte[length];
            stream.ReadBytes(buffer, length);
            MemoryStream  bodyStream = new MemoryStream(buffer);
            IBinaryReader bodyReader = Connection.FormatterFactory.CreateReader(new StreamAdapter(bodyStream));

            // check response status
            ValidateResponse(bodyReader, serverCommandVersion);

            // parse command result
            DeserializeResponse(bodyReader);
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StreamCache{T}"/> class.
        /// </summary>
        /// <param name="streamName">the name of the stream to read.</param>
        /// <param name="streamAdapter">the stream adapter to convert data from the stream into the type required by clients of this stream reader.</param>
        public StreamCache(string streamName, IStreamAdapter streamAdapter /*, object[] streamAdapterParameters*/)
        {
            if (string.IsNullOrWhiteSpace(streamName))
            {
                throw new ArgumentNullException(nameof(streamName));
            }

            this.StreamName    = streamName;
            this.StreamAdapter = streamAdapter;

            this.pool = PoolManager.Instance.GetPool <T>();

            this.readRequestsInternal = new List <ReadRequest>();
            this.readRequests         = new ReadOnlyCollection <ReadRequest>(this.readRequestsInternal);

            this.bufferLock  = new object();
            this.dataBuffer  = new List <Message <T> >(1000);
            this.indexBuffer = new List <StreamCacheEntry>(1000);

            var itemComparer = Comparer <Message <T> > .Create((m1, m2) => m1.OriginatingTime.CompareTo(m2.OriginatingTime));

            var indexComarer = Comparer <StreamCacheEntry> .Create((i1, i2) => i1.OriginatingTime.CompareTo(i2.OriginatingTime));

            this.data  = new ObservableKeyedCache <DateTime, Message <T> >(null, itemComparer, m => m.OriginatingTime);
            this.index = new ObservableKeyedCache <DateTime, StreamCacheEntry>(null, indexComarer, ie => ie.OriginatingTime);

            this.instantIndexView = null;

            this.instantStreamReaders = new List <EpsilonInstantStreamReader <T> >();

            if (this.needsDisposing)
            {
                this.data.CollectionChanged += this.OnCollectionChanged;
            }
        }
コード例 #4
0
        protected Stream GetStream(IStreamAdapter adapter)
        {
            PrivateObject          po       = new PrivateObject(adapter);
            StreamAdapter_Accessor accessor = new StreamAdapter_Accessor(po);

            return(accessor.Stream);
        }
コード例 #5
0
        public void SetUp()
        {
            _mocks = new MockRepository();

             _streamAdapter = _mocks.DynamicMock<IStreamAdapter>();
             _serializeAdapter = _mocks.DynamicMock<ISerializeAdapter>();
        }
コード例 #6
0
ファイル: InstantDataTarget.cs プロジェクト: xiangzhi/psi
 /// <summary>
 /// Initializes a new instance of the <see cref="InstantDataTarget"/> class.
 /// </summary>
 /// <param name="streamName">The name of the stream from which to receive updates when new data is available.</param>
 /// <param name="streamAdapter">The stream adapter to convert the raw stream data to the type required by the callback target.</param>
 /// <param name="cursorEpsilon">The cursor epsilon to use when searching for data.</param>
 /// <param name="callback">The method to call when new data is available.</param>
 public InstantDataTarget(string streamName, IStreamAdapter streamAdapter, RelativeTimeInterval cursorEpsilon, Action <object, IndexEntry> callback)
 {
     this.RegistrationToken = Guid.NewGuid();
     this.StreamName        = streamName;
     this.StreamAdapter     = streamAdapter;
     this.CursorEpsilon     = cursorEpsilon;
     this.Callback          = callback;
 }
コード例 #7
0
ファイル: StreamBinding.cs プロジェクト: maria-chang/psi
        /// <summary>
        /// Initializes a new instance of the <see cref="StreamBinding"/> class.
        /// </summary>
        /// <param name="source">An existing stream binding to clone.</param>
        /// <param name="summarizerType">The type of the stream summarizer, null if there is none.</param>
        /// <param name="summarizerArgs">The arguments used when constructing the stream summarizer, null if ther is none.</param>
        public StreamBinding(StreamBinding source, Type summarizerType, object[] summarizerArgs)
            : this(source.StreamName, source.PartitionName, source.StoreName, source.StorePath, source.SimpleReaderType, source.StreamAdapterType, summarizerType, summarizerArgs)
        {
            this.streamAdapter = source.streamAdapter;

            // Do not copy this over since the type or args may have changed
            this.summarizer = null;
        }
コード例 #8
0
		public IBinaryWriter CreateWriter(IStreamAdapter stream)
        {
            switch (_formatType)
            {
                case BinaryFormatType.BigEndian:
                    return new BigEndianBinaryWriter(stream, _encoding);
            }
            throw new NotSupportedException(String.Format(Messages.Exception_BinaryFormatNotSupported, Enum.GetName(typeof(BinaryFormatType), _formatType)));
        }
コード例 #9
0
 public IBinaryWriter CreateWriter(IStreamAdapter stream)
 {
     switch (_formatType)
     {
     case BinaryFormatType.BigEndian:
         return(new BigEndianBinaryWriter(stream, _encoding));
     }
     throw new NotSupportedException(String.Format(Messages.Exception_BinaryFormatNotSupported, Enum.GetName(typeof(BinaryFormatType), _formatType)));
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="AdaptingInstantDataProvider{TSource, TDestination}"/> class.
        /// </summary>
        /// <param name="streamAdapter">The stream adapter that will convert the incoming data to the data that the targets require.</param>
        public AdaptingInstantDataProvider(IStreamAdapter streamAdapter)
        {
            if (streamAdapter == null)
            {
                throw new ArgumentNullException(nameof(streamAdapter));
            }

            this.streamAdapter = streamAdapter as StreamAdapter <TSource, TDestination>;
            this.targets       = new Dictionary <Guid, InstantDataTarget>();
        }
コード例 #11
0
ファイル: DataStoreReader.cs プロジェクト: annelo-msft/psi
        private IStreamReader GetExistingStreamReader(string streamName, IStreamAdapter streamAdapter)
        {
            IStreamReader streamReader = this.streamReaders.Find(sr => sr.StreamName == streamName && sr.StreamAdapterType == streamAdapter?.GetType());

            if (streamReader == null)
            {
                throw new ArgumentException("No stream reader exists for the stream.");
            }

            return(streamReader);
        }
コード例 #12
0
ファイル: DataStoreReader.cs プロジェクト: annelo-msft/psi
        private IStreamReader GetOrCreateStreamReader <T>(string streamName, IStreamAdapter streamAdapter)
        {
            var streamReader = this.streamReaders.Find(sr => sr.StreamName == streamName && sr.StreamAdapterType == streamAdapter?.GetType());

            if (streamReader == null)
            {
                streamReader = new StreamReader <T>(streamName, streamAdapter);
                this.streamReaders.Add(streamReader);
            }

            return(streamReader);
        }
コード例 #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BinaryReaderBase"/> class based on the supplied stream and a specific character encoding.
        /// </summary>
        /// <param name="input">Input stream</param>
        /// <param name="encoding">The character encoding object used to decode strings from stream</param>
		protected BinaryReaderBase(IStreamAdapter input, Encoding encoding)
        {
            ArgumentAssert.IsNotNull(input, "input");
            ArgumentAssert.IsNotNull(encoding, "encoding");
            if (!input.CanRead)
            {
                throw new IOException(Messages.Exception_CantReadFromStream);
            }

            _inputStream = input;
            _encoding = encoding;
        }
コード例 #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BinaryReaderBase"/> class based on the supplied stream and a specific character encoding.
        /// </summary>
        /// <param name="input">Input stream</param>
        /// <param name="encoding">The character encoding object used to decode strings from stream</param>
        protected BinaryReaderBase(IStreamAdapter input, Encoding encoding)
        {
            ArgumentAssert.IsNotNull(input, "input");
            ArgumentAssert.IsNotNull(encoding, "encoding");
            if (!input.CanRead)
            {
                throw new IOException(Messages.Exception_CantReadFromStream);
            }

            _inputStream = input;
            _encoding    = encoding;
        }
コード例 #15
0
		protected BinaryWriterBase(IStreamAdapter output, Encoding encoding)
        {
            ArgumentAssert.IsNotNull(output, "output");
            ArgumentAssert.IsNotNull(encoding, "encoding");
            if (!output.CanWrite)
            {
                throw new IOException(Messages.Exception_CantWriteToStream);
            }

            _outputStream = output;
            _encoding = encoding;
        }
コード例 #16
0
        protected BinaryWriterBase(IStreamAdapter output, Encoding encoding)
        {
            ArgumentAssert.IsNotNull(output, "output");
            ArgumentAssert.IsNotNull(encoding, "encoding");
            if (!output.CanWrite)
            {
                throw new IOException(Messages.Exception_CantWriteToStream);
            }

            _outputStream = output;
            _encoding     = encoding;
        }
コード例 #17
0
ファイル: DataStoreReader.cs プロジェクト: xiangzhi/psi
        private IStreamReader GetStreamReader <T>(string streamName, IStreamAdapter streamAdapter, bool createIfNecessary)
        {
            var streamReader = this.streamReaders.Find(sr => sr.StreamName == streamName && sr.StreamAdapterType == streamAdapter?.GetType());

            if (streamReader == null)
            {
                if (createIfNecessary)
                {
                    streamReader = new StreamReader <T>(streamName, streamAdapter);
                    this.streamReaders.Add(streamReader);
                }
                else
                {
                    throw new ArgumentException("No stream reader exists for the stream binding.");
                }
            }

            return(streamReader);
        }
コード例 #18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StreamSource"/> class.
        /// </summary>
        /// <param name="partitionViewModel">The partition that is the stream's data source.</param>
        /// <param name="streamReaderType">The type of stream reader that should be used to read data from the store.</param>
        /// <param name="streamName">The name of the stream.</param>
        /// <param name="streamMetadata">The metadata for the stream.</param>
        /// <param name="streamAdapter">The stream adapter to use when reading stream data.</param>
        /// <param name="summarizer">The summarizer to use when reading the stream.</param>
        public StreamSource(
            PartitionViewModel partitionViewModel,
            Type streamReaderType,
            string streamName,
            IStreamMetadata streamMetadata,
            IStreamAdapter streamAdapter,
            ISummarizer summarizer)
        {
            this.StoreName        = partitionViewModel.StoreName;
            this.StorePath        = partitionViewModel.StorePath;
            this.StreamReaderType = streamReaderType;
            this.StreamName       = streamName;
            this.StreamMetadata   = streamMetadata;
            this.StreamAdapter    = streamAdapter;
            this.Summarizer       = summarizer;
            this.IsLive           = partitionViewModel.IsLivePartition;

            partitionViewModel.PropertyChanged += this.PartitionPropertyChanged;
        }
コード例 #19
0
        /// <summary>
        /// Creates a stream member adapter based on a specified visualizer metadata.  Any existing stream
        /// adapter in the given visualizer metadata will be preserved within the stream member adapter.
        /// </summary>
        /// <param name="visualizerMetadata">The visualizer metadata.</param>
        /// <param name="sourceDataType">The type of the stream's source data.</param>
        /// <returns>A new visualizer metadata containing a stream member adapter.</returns>
        internal static VisualizerMetadata CreateStreamMemberAdapter(VisualizerMetadata visualizerMetadata, Type sourceDataType)
        {
            // Clone the metadata
            var metadataClone = visualizerMetadata.DeepClone();

            // If the visualizer metadata already contains a stream adapter, create a stream member adapter that
            // encapsulates it, otherwise create a stream member adapter that adapts directly from the message
            // type to the member type.
            if (visualizerMetadata.StreamAdapterType != null)
            {
                IStreamAdapter existingStreamAdapter = (IStreamAdapter)Activator.CreateInstance(visualizerMetadata.StreamAdapterType);
                metadataClone.StreamAdapterType = typeof(StreamMemberAdapter <, , ,>).MakeGenericType(sourceDataType, existingStreamAdapter.SourceType, visualizerMetadata.StreamAdapterType, existingStreamAdapter.DestinationType);
            }
            else
            {
                metadataClone.StreamAdapterType = typeof(StreamMemberAdapter <,>).MakeGenericType(sourceDataType, metadataClone.DataType);
            }

            return(metadataClone);
        }
コード例 #20
0
        /// <summary>
        /// Serializes an command and graph of internal objects to the provided stream.
        /// </summary>
        /// <param name="stream">The stream where the command puts the serialized data.</param>
        /// <exception cref="IOException"/>
        internal protected override void Serialize(IStreamAdapter stream)
        {
            IBinaryWriter writer = Connection.FormatterFactory.CreateWriter(stream);

            // send command id and version information
            CommandInfo.Serialize(writer);

            // serialize request body to temp. buffer to get command body length
            MemoryStream  buffer       = new MemoryStream();
            IBinaryWriter bufferWriter = Connection.FormatterFactory.CreateWriter(new StreamAdapter(buffer));

            SerializeRequest(bufferWriter);
            // send body length first
            int length = (int)buffer.Length;

            writer.Write(length);
            // send buffer content
            buffer.Position = 0;
            stream.WriteBytes(buffer.ToArray(), length);
        }
コード例 #21
0
ファイル: StreamSource.cs プロジェクト: sandrist/psi
        /// <summary>
        /// Initializes a new instance of the <see cref="StreamSource"/> class.
        /// </summary>
        /// <param name="partitionViewModel">The partition that is the stream's data source.</param>
        /// <param name="streamReaderType">The type of stream reader that should be used to read data from the store.</param>
        /// <param name="streamName">The name of the stream.</param>
        /// <param name="streamMetadata">The metadata for the stream.</param>
        /// <param name="streamAdapter">The stream adapter to use when reading stream data.</param>
        /// <param name="summarizer">The summarizer to use when reading the stream.</param>
        /// <param name="allocator">The allocator to use when reading data.</param>
        /// <param name="deallocator">The deallocator to use when reading data.</param>
        public StreamSource(
            PartitionViewModel partitionViewModel,
            Type streamReaderType,
            string streamName,
            IStreamMetadata streamMetadata,
            IStreamAdapter streamAdapter,
            ISummarizer summarizer,
            Func <dynamic> allocator,
            Action <dynamic> deallocator)
        {
            this.StoreName        = partitionViewModel.StoreName;
            this.StorePath        = partitionViewModel.StorePath;
            this.StreamReaderType = streamReaderType;
            this.StreamName       = streamName;
            this.StreamMetadata   = streamMetadata;
            this.StreamAdapter    = streamAdapter;
            this.Summarizer       = summarizer;
            this.IsLive           = partitionViewModel.IsLivePartition;
            this.Allocator        = allocator;
            this.Deallocator      = deallocator;

            partitionViewModel.PropertyChanged += this.OnPartitionViewModelPropertyChanged;
        }
コード例 #22
0
 	protected internal override void Serialize(IStreamAdapter stream)
     {
         IBinaryWriter writer = Connection.FormatterFactory.CreateWriter(stream);
         CommandInfo.Serialize(writer);
     }
コード例 #23
0
		protected internal override void Deserialize(IStreamAdapter stream)
        {
            // do nothing
        }
コード例 #24
0
 public XmlWriterMock(IStreamAdapter output) : base(output, _defaultEncoding)
 {
 }
コード例 #25
0
		public XmlWriterMock(IStreamAdapter output, Encoding encoding): base(output, encoding)
        {
        }
コード例 #26
0
 public XmlWriterMock(IStreamAdapter output, Encoding encoding) : base(output, encoding)
 {
 }
コード例 #27
0
		public XmlReaderMock(IStreamAdapter input, Encoding encoding): base(input, encoding)
        {
        } 
コード例 #28
0
        protected internal override void Serialize(IStreamAdapter stream)
        {
            IBinaryWriter writer = Connection.FormatterFactory.CreateWriter(stream);

            CommandInfo.Serialize(writer);
        }
コード例 #29
0
 public IBinaryReader CreateReader(IStreamAdapter stream)
 {
     return(new XmlReaderMock(stream));
 }
コード例 #30
0
 protected internal override void Deserialize(IStreamAdapter stream)
 {
     // do nothing
 }
コード例 #31
0
		public BigEndianBinaryWriter(IStreamAdapter output): base(output)
		{
		}
コード例 #32
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BinaryReaderBase"/> class based on the supplied stream and a specific character encoding.
 /// </summary>
 /// <param name="input">Input stream</param>
 /// <param name="encoding">The character encoding object used to decode strings from stream</param>
 public BigEndianBinaryReader(IStreamAdapter input, Encoding encoding) : base(input, encoding)
 {
 }
コード例 #33
0
        private const int MAX_LENGTH = 8 * 1024 * 1024;         // 8MB (hardcoded in sphinxd)
        #endregion

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="BigEndianBinaryReader"/> class based on the supplied stream and using default encoding <see cref="UTF8Encoding"/>.
        /// </summary>
        /// <param name="input">Input stream</param>
        public BigEndianBinaryReader(IStreamAdapter input) : base(input)
        {
        }
コード例 #34
0
		public XmlWriterMock(IStreamAdapter output): base(output, _defaultEncoding)
        {
        }
コード例 #35
0
 public object Deserialize(IStreamAdapter streamAdapter)
 {
     return _serializer.Deserialize(streamAdapter.Stream);
 }
コード例 #36
0
 public IBinaryReader CreateReader(IStreamAdapter stream)
 {
     return new XmlReaderMock(stream);
 }
コード例 #37
0
 public void Serialize(IStreamAdapter streamAdapter, object argument)
 {
     _serializer.Serialize(streamAdapter.Stream, argument);
 }
コード例 #38
0
		protected Stream GetStream(IStreamAdapter adapter)
		{
			PrivateObject po = new PrivateObject(adapter);
			StreamAdapter_Accessor accessor = new StreamAdapter_Accessor(po);
			return accessor.Stream;
		}         
コード例 #39
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BinaryReaderBase"/> class based on the supplied stream and using default encoding <see cref="UTF8Encoding"/>.
 /// </summary>
 /// <param name="input">Input stream</param>
 protected BinaryReaderBase(IStreamAdapter input) : this(input, _defaultEncoding)
 {
 }
コード例 #40
0
		private const int MAX_LENGTH = 8 * 1024 * 1024; // 8MB (hardcoded in sphinxd)
		#endregion

		#region Constructors
		/// <summary>
		/// Initializes a new instance of the <see cref="BigEndianBinaryReader"/> class based on the supplied stream and using default encoding <see cref="UTF8Encoding"/>.
		/// </summary>
		/// <param name="input">Input stream</param>
		public BigEndianBinaryReader(IStreamAdapter input): base(input)
		{
		}
コード例 #41
0
		public XmlReaderMock(IStreamAdapter input): base(input, _defaultEncoding)
        {
        }
コード例 #42
0
 public IBinaryWriter CreateWriter(IStreamAdapter stream)
 {
     return(new XmlWriterMock(stream));
 }
コード例 #43
0
		protected BinaryWriterBase(IStreamAdapter output): this(output, _defaultEncoding)
        {
        }
コード例 #44
0
 public IBinaryWriter CreateWriter(IStreamAdapter stream)
 {
     return(new ArrayListWriterMock(_list));
 }
コード例 #45
0
ファイル: CommandBase.cs プロジェクト: ltbam/Sphinx.Client
        /// <summary>
        /// Deserializes the Sphinx server response data on the provided stream and reconstitutes the graph of objects.
        /// </summary>
        /// <param name="stream">The stream that contains the data to deserialize.</param>
		internal protected abstract void Deserialize(IStreamAdapter stream);
コード例 #46
0
ファイル: StreamBinding.cs プロジェクト: maria-chang/psi
 /// <summary>
 /// Initializes a new instance of the <see cref="StreamBinding"/> class.
 /// </summary>
 /// <param name="source">An existing stream binding to clone.</param>
 /// <param name="storeName">The store name.</param>
 /// <param name="storePath">The store path.</param>
 public StreamBinding(StreamBinding source, string storeName, string storePath)
     : this(source.StreamName, source.PartitionName, storeName, storePath, source.SimpleReaderType, source.StreamAdapterType, source.SummarizerType, source.SummarizerArgs)
 {
     this.streamAdapter = source.streamAdapter;
     this.summarizer    = source.summarizer;
 }
コード例 #47
0
		public BigEndianBinaryWriter(IStreamAdapter output, Encoding encoding): base(output, encoding)
		{
		}
コード例 #48
0
ファイル: XMLSerializeAdapter.cs プロジェクト: bsimser/xeva
 public void Serialize(IStreamAdapter streamAdapter, object messageDTO)
 {
     _serializer.Serialize(streamAdapter.Stream, messageDTO);
 }
コード例 #49
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StreamValuePublisher{TSource, TDestination}"/> class.
 /// </summary>
 /// <param name="streamAdapter">The stream adapter that will convert the incoming data to the data that the targets require.</param>
 public StreamValuePublisher(IStreamAdapter streamAdapter)
 {
     this.targets       = new Dictionary <Guid, Action <bool, TDestination, DateTime, DateTime> >();
     this.StreamAdapter = (streamAdapter ?? new PassthroughAdapter <TDestination>()) as StreamAdapter <TSource, TDestination>;
 }
コード例 #50
0
        public IBinaryReader CreateReader(IStreamAdapter stream)
        {
			return new ArrayListReaderMock(_list);
        }
コード例 #51
0
		public IBinaryWriter CreateWriter(IStreamAdapter stream)
        {
            return new XmlWriterMock(stream);
        }
コード例 #52
0
		public IBinaryWriter CreateWriter(IStreamAdapter stream)
        {
			return new ArrayListWriterMock(_list);
        }
コード例 #53
0
 public BinaryMessageSerializer(IStreamAdapter streamAdapter, ISerializeAdapter serializeAdapter)
 {
     _stream = streamAdapter;
      _serializer = serializeAdapter;
 }
コード例 #54
0
 public IBinaryReader CreateReader(IStreamAdapter stream)
 {
     return(new ArrayListReaderMock(_list));
 }
コード例 #55
0
		/// <summary>
		/// Initializes a new instance of the <see cref="BinaryReaderBase"/> class based on the supplied stream and a specific character encoding.
		/// </summary>
		/// <param name="input">Input stream</param>
		/// <param name="encoding">The character encoding object used to decode strings from stream</param>
		public BigEndianBinaryReader(IStreamAdapter input, Encoding encoding): base(input, encoding)
		{
		}
コード例 #56
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BinaryReaderBase"/> class based on the supplied stream and using default encoding <see cref="UTF8Encoding"/>.
        /// </summary>
        /// <param name="input">Input stream</param>
		protected BinaryReaderBase(IStreamAdapter input): this(input, _defaultEncoding)
        {
        }