/// <summary>Indicates whether this instance and a specified object are equal.</summary> /// <param name="obj">The object to compare with the current instance.</param> /// <returns> /// true if <paramref name="obj" /> and this instance are the same type and represent the same value; otherwise, false. /// </returns> public override bool Equals(object obj) { if (obj is AlternateDataStreamInfo) { AlternateDataStreamInfo other = (AlternateDataStreamInfo)obj; return(StreamName.Equals(other.StreamName) && Size.Equals(other.Size)); } return(false); }
/// <summary>Indicates whether this instance and a specified object are equal.</summary> /// <param name="obj">The object to compare with the current instance.</param> /// <returns> /// true if <paramref name="obj" /> and this instance are the same type and represent the same value; otherwise, false. /// </returns> public override bool Equals(object obj) { if (obj is AlternateDataStreamInfo) { AlternateDataStreamInfo other = (AlternateDataStreamInfo)obj; return(StreamName.Equals(other.StreamName, StringComparison.OrdinalIgnoreCase) && Size.Equals(other.Size)); } return(false); }
/// <summary>Reads a stream header from the current <see cref="T:AlternateDataStreamInfo"/>.</summary> /// <returns>The stream header read from the current <see cref="T:AlternateDataStreamInfo"/>, or <c>null</c> if the end-of-file /// was reached before the required number of bytes of a header could be read.</returns> /// <remarks>The stream must be positioned at where an actual header starts for the returned object to represent valid information.</remarks> public AlternateDataStreamInfo ReadStreamInfo() { // Return the first entry. return(AlternateDataStreamInfo.EnumerateStreamsInternal(null, null, SafeFileHandle, null, null, null, null).FirstOrDefault()); }
/// <summary>Returns <see cref="T:AlternateDataStreamInfo"/> instances, associated with the file.</summary> /// <returns>An <see cref="T:IEnumerable{AlternateDataStreamInfo}"/> collection of streams for the file specified by path.</returns> public IEnumerable <AlternateDataStreamInfo> EnumerateStreams() { return(AlternateDataStreamInfo.EnumerateStreamsInternal(null, null, SafeFileHandle, null, null, null, null)); }