コード例 #1
0
        /// <summary>
        /// Copies the specified storage stream to an exporter without deserializing the data.
        /// </summary>
        /// <param name="streamName">The name of the storage stream to copy.</param>
        /// <param name="writer">The store to copy to.</param>
        /// <param name="deliveryPolicy">An optional delivery policy.</param>
        public void CopyStream(string streamName, Exporter writer, DeliveryPolicy <Message <BufferReader> > deliveryPolicy = null)
        {
            // create the copy pipeline
            var meta = this.reader.GetMetadata(streamName);
            var raw  = this.OpenRawStream(meta);

            writer.Write(raw, meta, deliveryPolicy);
        }
コード例 #2
0
ファイル: Importer.cs プロジェクト: jayagupta678/psi
        /// <summary>
        /// Copies the specified storage stream to an exporter without deserializing the data.
        /// </summary>
        /// <param name="streamName">The name of the storage stream to copy.</param>
        /// <param name="writer">The store to copy to.</param>
        /// <param name="deliveryPolicy">An optional delivery policy.</param>
        public void CopyStream(string streamName, Exporter writer, DeliveryPolicy deliveryPolicy = null)
        {
            var meta = this.reader.GetMetadata(streamName);

            this.reader.OpenStream(meta); // this checks for duplicates but bypasses type checks

            // create the copy pipeline
            var splitterOut = this.splitter.Add(meta.Id);

            writer.Write(splitterOut, meta, deliveryPolicy);
        }
コード例 #3
0
            /// <summary>
            /// Copies the specified stream to an exporter without deserializing the data.
            /// </summary>
            /// <param name="streamName">The name of the stream to copy.</param>
            /// <param name="writer">The store to copy to.</param>
            /// <param name="deliveryPolicy">An optional delivery policy.</param>
            internal void CopyStream(string streamName, Exporter writer, DeliveryPolicy <Message <BufferReader> > deliveryPolicy = null)
            {
                // create the copy pipeline
                if (this.streamReader.GetStreamMetadata(streamName) is not PsiStreamMetadata psiStreamMetadata)
                {
                    throw new NotSupportedException($"Copying streams requires a {nameof(PsiStoreStreamReader)}.");
                }

                var raw = this.OpenRawStream(psiStreamMetadata);

                writer.Write(raw.Out, psiStreamMetadata, deliveryPolicy);
            }
コード例 #4
0
ファイル: Importer.cs プロジェクト: swipswaps/psi
        /// <summary>
        /// Copies the specified stream to an exporter without deserializing the data.
        /// </summary>
        /// <param name="streamName">The name of the stream to copy.</param>
        /// <param name="writer">The store to copy to.</param>
        /// <param name="deliveryPolicy">An optional delivery policy.</param>
        public void CopyStream(string streamName, Exporter writer, DeliveryPolicy <Message <BufferReader> > deliveryPolicy = null)
        {
            // create the copy pipeline
            var meta = this.streamReader.GetStreamMetadata(streamName) as PsiStreamMetadata;

            if (meta == null)
            {
                throw new NotSupportedException("Copying streams is supported only with PsiStoreStreamReader.");
            }

            var raw = this.OpenRawStream(meta);

            writer.Write(raw.Out, meta, deliveryPolicy);
        }