/// <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; }
/// <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); }
/// <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 ); }
/// <summary> /// Internal usage. Does not verify parameter. /// </summary> private bool InternalPositionEquals( QuickIOFileChunk chunk ) { return ( Position != chunk.Position ); }
/// <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 ) ); }
/// <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)); }
/// <summary> /// Internal usage. Does not verify parameter. /// </summary> private bool InternalPositionEquals(QuickIOFileChunk chunk) { return(Position == chunk.Position); }
/// <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 ); }
/// <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 ); }
/// <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 ) ); }