/// <summary> /// Creates a new binary reader that reads the raw contents of the segment. /// </summary> /// <returns>The created binary reader.</returns> /// <param name="segment">The segment to read from.</param> /// <param name="fileOffset">The starting file offset of the reader.</param> public static BinaryStreamReader CreateReader(this IReadableSegment segment, ulong fileOffset) { return(segment.CreateReader(fileOffset, (uint)(segment.GetPhysicalSize() - (fileOffset - segment.Offset)))); }
/// <inheritdoc /> public override uint GetPhysicalSize() => _contents.GetPhysicalSize();
/// <summary> /// Creates a new binary reader that reads the raw contents of the segment. /// </summary> /// <param name="segment">The segment to read from.</param> /// <returns>The created binary reader.</returns> public static BinaryStreamReader CreateReader(this IReadableSegment segment) { return(segment.CreateReader(segment.Offset, segment.GetPhysicalSize())); }