/// <inheritdoc/>
        public unsafe IImageStream Create(FileOffset offset, long length)
        {
            if ((long)offset < 0 || length < 0)
            {
                return(MemoryImageStream.CreateEmpty());
            }

            long offs = Math.Min(Length, (long)offset);
            long len  = Math.Min(Length - offs, length);

            return(new UnmanagedMemoryImageStream(owner, (FileOffset)((long)fileOffset + (long)offset), startAddr + (long)offs, len));
        }
Exemple #2
0
        /// <inheritdoc/>
        public IImageStream Create(FileOffset offset, long length)
        {
            if ((long)offset < 0 || length < 0)
            {
                return(MemoryImageStream.CreateEmpty());
            }

            int offs = (int)Math.Min((long)Length, (long)offset);
            int len  = (int)Math.Min((long)Length - offs, length);

            return(new MemoryImageStream((FileOffset)((long)fileOffset + (long)offset), data, dataOffset + offs, len));
        }
        /// <inheritdoc/>
        public unsafe IImageStream Create(FileOffset offset, long length)
        {
            if (offset < 0 || length < 0)
            {
                return(MemoryImageStream.CreateEmpty());
            }

            long offs = Math.Min((long)dataLength, (long)offset);
            long len  = Math.Min((long)dataLength - offs, length);

            return(new UnmanagedMemoryImageStream(this, offset, offs, len));
        }