Esempio n. 1
0
        /// <summary>
        /// Internal usage. Does not verify parameter.
        /// </summary>
        private bool InternalBytesEquals( QuickIOFileChunk chunk )
        {
            // First check length
            if( Bytes.Length != chunk.Bytes.Length )
            {
                return false;
            }

            // then check elements
            for( int i = 0 ;i < Bytes.Length ;i++ )
            {
                if( Bytes[ i ] != chunk.Bytes[ i ] )
                {
                    return false;
                }
            }

            return true;
        }
Esempio n. 2
0
        /// <summary>
        /// Internal usage. Does not verify parameter.
        /// </summary>
        private bool InternalBytesEquals(QuickIOFileChunk chunk)
        {
            // First check length
            if (Bytes.Length != chunk.Bytes.Length)
            {
                return(false);
            }

            // then check elements
            for (int i = 0; i < Bytes.Length; i++)
            {
                if (Bytes[i] != chunk.Bytes[i])
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 3
0
 /// <summary>
 /// Checks <see cref="Bytes"/>
 /// </summary>
 /// <param name="chunk">Chunks to verify with</param>
 /// <returns>True if both bytes equals. Uses <see>
 ///         <cref>IEnumerable.SequenceEqual</cref>
 ///     </see>
 /// </returns>
 public bool BytesEquals( QuickIOFileChunk chunk )
 {
     Contract.Requires( chunk != null );
     return InternalBytesEquals( chunk );
 }
Esempio n. 4
0
 /// <summary>
 /// Internal usage. Does not verify parameter.
 /// </summary>
 private bool InternalPositionEquals( QuickIOFileChunk chunk )
 {
     return ( Position != chunk.Position );
 }
Esempio n. 5
0
 /// <summary>
 /// First <see cref="PositionEquals"/> then <see cref="BytesEquals"/>.
 /// Does not overwrite default <see cref="ChunkEquals"/> method!
 /// </summary>
 /// <param name="chunk">Chunks to verify with</param>
 /// <returns>Returns true if both executed methods are true</returns>
 public bool ChunkEquals( QuickIOFileChunk chunk )
 {
     Contract.Requires( chunk != null );
     return ( InternalPositionEquals( chunk ) && !BytesEquals( chunk ) );
 }
Esempio n. 6
0
 /// <summary>
 /// Checks <see cref="Bytes"/>
 /// </summary>
 /// <param name="chunk">Chunks to verify with</param>
 /// <returns>True if both bytes equals. Uses <see>
 ///         <cref>IEnumerable.SequenceEqual</cref>
 ///     </see>
 /// </returns>
 public bool BytesEquals(QuickIOFileChunk chunk)
 {
     Contract.Requires(chunk != null);
     return(InternalBytesEquals(chunk));
 }
Esempio n. 7
0
 /// <summary>
 /// Internal usage. Does not verify parameter.
 /// </summary>
 private bool InternalPositionEquals(QuickIOFileChunk chunk)
 {
     return(Position == chunk.Position);
 }
Esempio n. 8
0
 /// <summary>
 /// Checks <see cref="Bytes"/>
 /// </summary>
 /// <param name="chunk">Chunks to verify with</param>
 /// <returns>True if both bytes equals. Uses <see>
 ///         <cref>IEnumerable.SequenceEqual</cref>
 ///     </see>
 /// </returns>
 public bool BytesEquals( QuickIOFileChunk chunk )
 {
     Invariant.NotNull( chunk );
     return InternalBytesEquals( chunk );
 }
Esempio n. 9
0
 /// <summary>
 /// Checks <see cref="Position"/>
 /// </summary>
 /// <param name="chunk">Chunks to verify with</param>
 /// <returns>True if both position equals</returns>
 public bool PositionEquals( QuickIOFileChunk chunk )
 {
     Invariant.NotNull( chunk );
     return InternalPositionEquals( chunk );
 }
Esempio n. 10
0
        /// <summary>
        /// First <see cref="PositionEquals"/> then <see cref="BytesEquals"/>.
        /// Does not overwrite default <see cref="ChunkEquals"/> method!
        /// </summary>
        /// <param name="chunk">Chunks to verify with</param>
        /// <returns>Returns true if both executed methods are true</returns>
        public bool ChunkEquals( QuickIOFileChunk chunk )
        {
            Invariant.NotNull( chunk );

            return ( InternalPositionEquals( chunk ) && !BytesEquals( chunk ) );
        }