Skip to content

Commit

Permalink
Address feedback.
Browse files Browse the repository at this point in the history
Enable GenerateDocumentationFile.
  • Loading branch information
carlossanlop committed Jan 29, 2021
1 parent f01dd64 commit 3f2de7e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override int ReadByte()
/// <summary>Reads a sequence of bytes from the current Brotli stream to a byte span and advances the position within the Brotli stream by the number of bytes read.</summary>
/// <param name="buffer">A region of memory. When this method returns, the contents of this region are replaced by the bytes read from the current source.</param>
/// <returns>The total number of bytes read into the buffer. This can be less than the number of bytes allocated in the buffer if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.</returns>
/// <remarks>Use the <see cref="System.IO.Compression.BrotliStream.CanRead" /> property to determine whether the current instance supports reading. Use the <see cref="System.IO.Compression.BrotliStream.ReadAsync" /> method to read asynchronously from the current stream.
/// <remarks>Use the <see cref="System.IO.Compression.BrotliStream.CanRead" /> property to determine whether the current instance supports reading. Use the <see langword="System.IO.Compression.BrotliStream.ReadAsync" /> method to read asynchronously from the current stream.
/// This method read a maximum of `buffer.Length` bytes from the current stream and store them in <paramref name="buffer" />. The current position within the Brotli stream is advanced by the number of bytes read; however, if an exception occurs, the current position within the Brotli stream remains unchanged. This method will block until at least one byte of data can be read, in the event that no data is available. `Read` returns 0 only when there is no more data in the stream and no more is expected (such as a closed socket or end of file). The method is free to return fewer bytes than requested even if the end of the stream has not been reached.
/// Use <see cref="System.IO.BinaryReader" /> for reading primitive data types.</remarks>
public override int Read(Span<byte> buffer)
Expand Down Expand Up @@ -105,9 +105,9 @@ public override int Read(Span<byte> buffer)
return totalWritten;
}

/// <summary>Begins an asynchronous read operation. (Consider using the <see cref="System.IO.Stream.ReadAsync(System.Byte[],System.Int32,System.Int32)" /> method instead.)</summary>
/// <summary>Begins an asynchronous read operation. (Consider using the <see cref="System.IO.Stream.ReadAsync(byte[],int,int)" /> method instead.)</summary>
/// <param name="buffer">The buffer from which data will be read.</param>
/// <param name="offset">The byte offset in <paramref name="array" /> at which to begin reading data from the stream.</param>
/// <param name="offset">The byte offset in <paramref name="buffer" /> at which to begin reading data from the stream.</param>
/// <param name="count">To maximum number of bytes to read.</param>
/// <param name="asyncCallback">An optional asynchronous callback, to be called when the read operation is complete.</param>
/// <param name="asyncState">A user-provided object that distinguishes this particular asynchronous read request from other requests.</param>
Expand All @@ -120,11 +120,11 @@ public override int Read(Span<byte> buffer)
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback? asyncCallback, object? asyncState) =>
TaskToApm.Begin(ReadAsync(buffer, offset, count, CancellationToken.None), asyncCallback, asyncState);

/// <summary>Waits for the pending asynchronous read to complete. (Consider using the <see cref="System.IO.Stream.ReadAsync(System.Byte[],System.Int32,System.Int32)" /> method instead.)</summary>
/// <summary>Waits for the pending asynchronous read to complete. (Consider using the <see cref="System.IO.Stream.ReadAsync(byte[],int,int)" /> method instead.)</summary>
/// <param name="asyncResult">The reference to the pending asynchronous request to finish.</param>
/// <returns>The number of bytes read from the stream, between 0 (zero) and the number of bytes you requested. <see cref="System.IO.Compression.BrotliStream" /> returns 0 only at the end of the stream; otherwise, it blocks until at least one byte is available.</returns>
/// <exception cref="System.ArgumentNullException"><paramref name="asyncResult" /> is <see langword="null" />.</exception>
/// <exception cref="System.ArgumentException"><paramref name="asyncResult" /> did not originate from a <see cref="System.IO.Compression.BrotliStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> method on the current stream.</exception>
/// <exception cref="System.ArgumentException"><paramref name="asyncResult" /> did not originate from a <see cref="System.IO.Compression.BrotliStream.BeginRead(byte[],int,int,System.AsyncCallback,object)" /> method on the current stream.</exception>
/// <exception cref="System.InvalidOperationException">The end operation cannot be performed because the stream is closed.</exception>
public override int EndRead(IAsyncResult asyncResult) =>
TaskToApm.End<int>(asyncResult);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ internal void SetWindow(int window)
}

/// <summary>Gets the maximum expected compressed length for the provided input size.</summary>
/// <param name="inputSize">The input size to get the maximum expected compressed length from. Must be greater or equal than 0 and less or equal than <see cref="System.Int32.MaxValue" /> - 515.</param>
/// <param name="inputSize">The input size to get the maximum expected compressed length from. Must be greater or equal than 0 and less or equal than <see cref="int.MaxValue" /> - 515.</param>
/// <returns>A number representing the maximum compressed length for the provided input size.</returns>
/// <remarks>Returns 1 if <paramref name="inputSize" /> is 0.</remarks>
/// <exception cref="System.ArgumentOutOfRangeException"><paramref name="inputSize" /> is less than 0, the minimum allowed input size, or greater than <see cref="System.Int32.MaxValue" /> - 515, the maximum allowed input size.</exception>
/// <exception cref="System.ArgumentOutOfRangeException"><paramref name="inputSize" /> is less than 0, the minimum allowed input size, or greater than <see cref="int.MaxValue" /> - 515, the maximum allowed input size.</exception>
public static int GetMaxCompressedLength(int inputSize)
{
if (inputSize < 0 || inputSize > BrotliUtils.MaxInputSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public BrotliStream(Stream stream, CompressionLevel compressionLevel, bool leave

/// <summary>Writes compressed bytes to the underlying stream from the specified byte array.</summary>
/// <param name="buffer">The buffer containing the data to compress.</param>
/// <param name="offset">The byte offset in <paramref name="array" /> from which the bytes will be read.</param>
/// <param name="offset">The byte offset in <paramref name="buffer" /> from which the bytes will be read.</param>
/// <param name="count">The maximum number of bytes to write.</param>
/// <exception cref="System.ObjectDisposedException">The write operation cannot be performed because the stream is closed.</exception>
public override void Write(byte[] buffer, int offset, int count)
Expand All @@ -44,7 +44,7 @@ public override void WriteByte(byte value)

/// <summary>Writes a sequence of bytes to the current Brotli stream from a read-only byte span and advances the current position within this Brotli stream by the number of bytes written.</summary>
/// <param name="buffer">A region of memory. This method copies the contents of this region to the current Brotli stream.</param>
/// <remarks>Use the <see cref="System.IO.Compression.BrotliStream.CanWrite" /> property to determine whether the current instance supports writing. Use the <see cref="System.IO.Compression.BrotliStream.WriteAsync" /> method to write asynchronously to the current stream.
/// <remarks>Use the <see cref="System.IO.Compression.BrotliStream.CanWrite" /> property to determine whether the current instance supports writing. Use the <see langword="System.IO.Compression.BrotliStream.WriteAsync" /> method to write asynchronously to the current stream.
/// If the write operation is successful, the position within the Brotli stream advances by the number of bytes written. If an exception occurs, the position within the Brotli stream remains unchanged.</remarks>
public override void Write(ReadOnlySpan<byte> buffer)
{
Expand Down Expand Up @@ -73,9 +73,9 @@ internal void WriteCore(ReadOnlySpan<byte> buffer, bool isFinalBlock = false)
}
}

/// <summary>Begins an asynchronous write operation. (Consider using the <see cref="System.IO.Stream.WriteAsync(System.Byte[],System.Int32,System.Int32)" /> method instead.)</summary>
/// <summary>Begins an asynchronous write operation. (Consider using the <see cref="System.IO.Stream.WriteAsync(byte[],int,int)" /> method instead.)</summary>
/// <param name="buffer">The buffer from which data will be written.</param>
/// <param name="offset">The byte offset in <paramref name="array" /> at which to begin writing data from the stream.</param>
/// <param name="offset">The byte offset in <paramref name="buffer" /> at which to begin writing data from the stream.</param>
/// <param name="count">The maximum number of bytes to write.</param>
/// <param name="asyncCallback">An optional asynchronous callback, to be called when the write operation is complete.</param>
/// <param name="asyncState">A user-provided object that distinguishes this particular asynchronous write request from other requests.</param>
Expand All @@ -88,7 +88,7 @@ internal void WriteCore(ReadOnlySpan<byte> buffer, bool isFinalBlock = false)
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback? asyncCallback, object? asyncState) =>
TaskToApm.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), asyncCallback, asyncState);

/// <summary>Handles the end of an asynchronous write operation. (Consider using the <see cref="System.IO.Stream.WriteAsync(System.Byte[],System.Int32,System.Int32)" /> method instead.)</summary>
/// <summary>Handles the end of an asynchronous write operation. (Consider using the <see cref="System.IO.Stream.WriteAsync(byte[],int,int)" /> method instead.)</summary>
/// <param name="asyncResult">The object that represents the asynchronous call.</param>
/// <exception cref="System.InvalidOperationException">The underlying stream is closed or <see langword="null" />.</exception>
public override void EndWrite(IAsyncResult asyncResult) =>
Expand Down

0 comments on commit 3f2de7e

Please sign in to comment.