public ByteData PullData(long offset, int size)
        {
            int readableSize = SourceUtil.GetReadableSize(this.Size, offset, size);

            if (readableSize == 0)
            {
                return(new ByteData(new ArraySegment <byte>()));
            }
            return(new ByteData(new ArraySegment <byte>(this.m_buffer, this.m_offset + (int)offset, readableSize)));
        }
        public ByteData PullData(long offset, int size)
        {
            int readableSize = SourceUtil.GetReadableSize(this.Size, offset, size);

            if (readableSize == 0)
            {
                return(new ByteData(new ArraySegment <byte>()));
            }
            return(new ByteData(new ArraySegment <byte>(new byte[readableSize])));
        }
        public ByteData PullData(long offset, int size)
        {
            int readableSize = SourceUtil.GetReadableSize(this.Size, offset, size);

            if (readableSize == 0)
            {
                return(new ByteData(new ArraySegment <byte>()));
            }
            this.m_stream.Seek(offset, SeekOrigin.Begin);
            byte[] numArray = new byte[readableSize];
            this.m_stream.Read(numArray, 0, readableSize);
            return(new ByteData(new ArraySegment <byte>(numArray, 0, readableSize)));
        }
Exemple #4
0
        public ByteData PullData(long offset, int size)
        {
            int readableSize = SourceUtil.GetReadableSize(this.Size, offset, size);

            if (readableSize == 0)
            {
                return(new ByteData(new ArraySegment <byte>()));
            }
            byte[] numArray = new byte[size];
            int    count    = 0;

            using (Stream stream = (Stream) new SubStream((Stream) new FileStream(this.m_filePath, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, FileOptions.SequentialScan), this.m_offset, this.Size))
            {
                stream.Seek(offset, SeekOrigin.Begin);
                count = stream.Read(numArray, 0, readableSize);
            }
            return(new ByteData(new ArraySegment <byte>(numArray, 0, count)));
        }
        public ByteData PullData(long offset, int size)
        {
            int readableSize = SourceUtil.GetReadableSize(this.Size, offset, size);

            return(this.m_sink.GetMasterHash(offset, readableSize));
        }