private void VerifyThatStreamResultsInCorrectNumberOfStreamParts(int streamSize, int expectedNumberOfStreamParts)
        {
            var stream = StreamHelper.GetStream(streamSize);

            var streamSplitter = new StreamSplitter();
            int count = 0;
            streamSplitter.StreamPartAvailable += streamPart => count++;

            streamSplitter.Split(stream);

            Assert.That(count, Is.EqualTo(expectedNumberOfStreamParts));
        }
Esempio n. 2
0
        private void VerifyThatStreamResultsInCorrectNumberOfStreamParts(int streamSize, int expectedNumberOfStreamParts)
        {
            var stream = StreamHelper.GetStream(streamSize);

            var streamSplitter = new StreamSplitter();
            int count          = 0;

            streamSplitter.StreamPartAvailable += streamPart => count++;

            streamSplitter.Split(stream);

            Assert.That(count, Is.EqualTo(expectedNumberOfStreamParts));
        }
Esempio n. 3
0
 public static IEnumerable <byte[]> splitIDX(Stream input, Encoding encoding)
 {
     return(StreamSplitter.Split(input, encoding.GetBytes(documentDelimiter), 128 * 1024));
 }