コード例 #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;
        }
コード例 #2
0
ファイル: QuickIOFileChunk.cs プロジェクト: nagyist/QuickIO
        /// <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);
        }
コード例 #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 );
 }
コード例 #4
0
 /// <summary>
 /// Internal usage. Does not verify parameter.
 /// </summary>
 private bool InternalPositionEquals( QuickIOFileChunk chunk )
 {
     return ( Position != chunk.Position );
 }
コード例 #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 ) );
 }
コード例 #6
0
ファイル: QuickIOFileChunk.cs プロジェクト: nagyist/QuickIO
 /// <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));
 }
コード例 #7
0
ファイル: QuickIOFileChunk.cs プロジェクト: nagyist/QuickIO
 /// <summary>
 /// Internal usage. Does not verify parameter.
 /// </summary>
 private bool InternalPositionEquals(QuickIOFileChunk chunk)
 {
     return(Position == chunk.Position);
 }
コード例 #8
0
ファイル: QuickIOFileChunk.cs プロジェクト: Kudach/QuickIO
 /// <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 );
 }
コード例 #9
0
ファイル: QuickIOFileChunk.cs プロジェクト: Kudach/QuickIO
 /// <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 );
 }
コード例 #10
0
ファイル: QuickIOFileChunk.cs プロジェクト: Kudach/QuickIO
        /// <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 ) );
        }