Exemple #1
0
        /// <summary>
        /// Returns the content of the entire memory block.
        /// </summary>
        /// <remarks>
        /// Does not check bounds.
        ///
        /// Only creates a copy of the data if they are not represented by a managed byte array,
        /// or if the specified range doesn't span the entire block.
        /// </remarks>
        public unsafe virtual ImmutableArray <byte> GetContentUnchecked(int start, int length)
        {
            var result = BlobUtilities.ReadImmutableBytes(Pointer + start, length);

            GC.KeepAlive(this);
            return(result);
        }
Exemple #2
0
 internal byte[] PeekBytes(int offset, int byteCount)
 {
     CheckBounds(offset, byteCount);
     return(BlobUtilities.ReadBytes(Pointer + offset, byteCount));
 }