-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
📚 documentationPri3Indicates issues/PRs that are low priorityIndicates issues/PRs that are low priorityarea-System.IOdoc-bugProblem with the content; needs to be fixedProblem with the content; needs to be fixeddocumentation
Milestone
Description
There are no exceptions documented for Stream.Read(Span<byte>)
or Stream.Write(ReadOnlySpan<byte>)
. These methods can throw IOException
, NotSupportedException
, and ObjectDisposedException
.
dotnet-api-docs/xml/System.IO/Stream.xml
Lines 1953 to 2009 in 1fc7056
<Member MemberName="Read"> | |
<MemberSignature Language="C#" Value="public virtual int Read (Span<byte> buffer);" /> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance int32 Read(valuetype System.Span`1<unsigned int8> buffer) cil managed" /> | |
<MemberSignature Language="DocId" Value="M:System.IO.Stream.Read(System.Span{System.Byte})" /> | |
<MemberSignature Language="VB.NET" Value="Public Overridable Function Read (buffer As Span(Of Byte)) As Integer" /> | |
<MemberSignature Language="F#" Value="abstract member Read : Span<byte> -> int
override this.Read : Span<byte> -> int" Usage="stream.Read buffer" /> | |
<MemberSignature Language="C++ CLI" Value="public:
 virtual int Read(Span<System::Byte> buffer);" /> | |
<MemberType>Method</MemberType> | |
<AssemblyInfo> | |
<AssemblyName>System.Runtime</AssemblyName> | |
<AssemblyVersion>4.2.1.0</AssemblyVersion> | |
<AssemblyVersion>4.2.2.0</AssemblyVersion> | |
<AssemblyVersion>5.0.0.0</AssemblyVersion> | |
<AssemblyVersion>6.0.0.0</AssemblyVersion> | |
<AssemblyVersion>7.0.0.0</AssemblyVersion> | |
<AssemblyVersion>8.0.0.0</AssemblyVersion> | |
</AssemblyInfo> | |
<AssemblyInfo> | |
<AssemblyName>mscorlib</AssemblyName> | |
</AssemblyInfo> | |
<AssemblyInfo> | |
<AssemblyName>netstandard</AssemblyName> | |
<AssemblyVersion>2.1.0.0</AssemblyVersion> | |
</AssemblyInfo> | |
<AssemblyInfo> | |
<AssemblyName>System.IO</AssemblyName> | |
</AssemblyInfo> | |
<Attributes> | |
<Attribute FrameworkAlternate="net-8.0"> | |
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(0)]</AttributeName> | |
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(0)>]</AttributeName> | |
</Attribute> | |
</Attributes> | |
<ReturnValue> | |
<ReturnType>System.Int32</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="buffer" Type="System.Span<System.Byte>" Index="0" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0;net-6.0;net-7.0;net-8.0" /> | |
</Parameters> | |
<Docs> | |
<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> | |
<summary>When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.</summary> | |
<returns>The total number of bytes read into the buffer. This can be less than the size of the buffer if that many bytes are not currently available, or zero (0) if the buffer's length is zero or the end of the stream has been reached.</returns> | |
<remarks> | |
<format type="text/markdown"><![CDATA[ | |
## Remarks | |
Use the <xref:System.IO.Stream.CanRead%2A> property to determine whether the current instance supports reading. Use the <xref:System.IO.Stream.ReadAsync%2A> method to read asynchronously from the current stream. | |
Implementations of this method read a maximum of `buffer.Length` bytes from the current stream and store them in `buffer`. The current position within the stream is advanced by the number of bytes read; however, if an exception occurs, the current position within the stream remains unchanged. Implementations return the number of bytes read. If more than zero bytes are requested, the implementation will not complete the operation until at least one byte of data can be read (if zero bytes were requested, some implementations may similarly not complete until at least one byte is available, but no data will be consumed from the stream in such a case). <xref:System.IO.Stream.Read%2A> returns 0 only if zero bytes were requested or when there is no more data in the stream and no more is expected (such as a closed socket or end of file). An implementation is free to return fewer bytes than requested even if the end of the stream has not been reached. | |
Use <xref:System.IO.BinaryReader> for reading primitive data types. | |
]]></format> | |
</remarks> | |
</Docs> | |
</Member> |
dotnet-api-docs/xml/System.IO/Stream.xml
Lines 3115 to 3168 in 1fc7056
<Member MemberName="Write"> | |
<MemberSignature Language="C#" Value="public virtual void Write (ReadOnlySpan<byte> buffer);" /> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Write(valuetype System.ReadOnlySpan`1<unsigned int8> buffer) cil managed" /> | |
<MemberSignature Language="DocId" Value="M:System.IO.Stream.Write(System.ReadOnlySpan{System.Byte})" /> | |
<MemberSignature Language="VB.NET" Value="Public Overridable Sub Write (buffer As ReadOnlySpan(Of Byte))" /> | |
<MemberSignature Language="F#" Value="abstract member Write : ReadOnlySpan<byte> -> unit
override this.Write : ReadOnlySpan<byte> -> unit" Usage="stream.Write buffer" /> | |
<MemberSignature Language="C++ CLI" Value="public:
 virtual void Write(ReadOnlySpan<System::Byte> buffer);" /> | |
<MemberType>Method</MemberType> | |
<AssemblyInfo> | |
<AssemblyName>System.Runtime</AssemblyName> | |
<AssemblyVersion>4.2.1.0</AssemblyVersion> | |
<AssemblyVersion>4.2.2.0</AssemblyVersion> | |
<AssemblyVersion>5.0.0.0</AssemblyVersion> | |
<AssemblyVersion>6.0.0.0</AssemblyVersion> | |
<AssemblyVersion>7.0.0.0</AssemblyVersion> | |
<AssemblyVersion>8.0.0.0</AssemblyVersion> | |
</AssemblyInfo> | |
<AssemblyInfo> | |
<AssemblyName>mscorlib</AssemblyName> | |
</AssemblyInfo> | |
<AssemblyInfo> | |
<AssemblyName>netstandard</AssemblyName> | |
<AssemblyVersion>2.1.0.0</AssemblyVersion> | |
</AssemblyInfo> | |
<AssemblyInfo> | |
<AssemblyName>System.IO</AssemblyName> | |
</AssemblyInfo> | |
<Attributes> | |
<Attribute FrameworkAlternate="net-8.0"> | |
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(0)]</AttributeName> | |
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(0)>]</AttributeName> | |
</Attribute> | |
</Attributes> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="buffer" Type="System.ReadOnlySpan<System.Byte>" Index="0" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0;net-6.0;net-7.0;net-8.0" /> | |
</Parameters> | |
<Docs> | |
<param name="buffer">A region of memory. This method copies the contents of this region to the current stream.</param> | |
<summary>When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.</summary> | |
<remarks> | |
<format type="text/markdown"><![CDATA[ | |
## Remarks | |
Use the <xref:System.IO.Stream.CanWrite%2A> property to determine whether the current instance supports writing. Use the <xref:System.IO.Stream.WriteAsync%2A> method to write asynchronously to the current stream. | |
If the write operation is successful, the position within the stream advances by the number of bytes written. If an exception occurs, the position within the stream remains unchanged. | |
]]></format> | |
</remarks> | |
</Docs> | |
</Member> |
Likewise, BinaryWriter.Write(ReadOnlySpan<byte>)
.
dotnet-api-docs/xml/System.IO/BinaryWriter.xml
Lines 1836 to 1883 in 1fc7056
<Member MemberName="Write"> | |
<MemberSignature Language="C#" Value="public virtual void Write (ReadOnlySpan<byte> buffer);" /> | |
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Write(valuetype System.ReadOnlySpan`1<unsigned int8> buffer) cil managed" /> | |
<MemberSignature Language="DocId" Value="M:System.IO.BinaryWriter.Write(System.ReadOnlySpan{System.Byte})" /> | |
<MemberSignature Language="VB.NET" Value="Public Overridable Sub Write (buffer As ReadOnlySpan(Of Byte))" /> | |
<MemberSignature Language="F#" Value="abstract member Write : ReadOnlySpan<byte> -> unit
override this.Write : ReadOnlySpan<byte> -> unit" Usage="binaryWriter.Write buffer" /> | |
<MemberSignature Language="C++ CLI" Value="public:
 virtual void Write(ReadOnlySpan<System::Byte> buffer);" /> | |
<MemberType>Method</MemberType> | |
<AssemblyInfo> | |
<AssemblyName>System.Runtime.Extensions</AssemblyName> | |
<AssemblyVersion>4.2.1.0</AssemblyVersion> | |
<AssemblyVersion>4.2.2.0</AssemblyVersion> | |
</AssemblyInfo> | |
<AssemblyInfo> | |
<AssemblyName>mscorlib</AssemblyName> | |
</AssemblyInfo> | |
<AssemblyInfo> | |
<AssemblyName>netstandard</AssemblyName> | |
<AssemblyVersion>2.1.0.0</AssemblyVersion> | |
</AssemblyInfo> | |
<AssemblyInfo> | |
<AssemblyName>System.IO</AssemblyName> | |
</AssemblyInfo> | |
<AssemblyInfo> | |
<AssemblyName>System.Runtime</AssemblyName> | |
<AssemblyVersion>5.0.0.0</AssemblyVersion> | |
<AssemblyVersion>6.0.0.0</AssemblyVersion> | |
<AssemblyVersion>7.0.0.0</AssemblyVersion> | |
<AssemblyVersion>8.0.0.0</AssemblyVersion> | |
</AssemblyInfo> | |
<Attributes> | |
<Attribute FrameworkAlternate="net-8.0"> | |
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(0)]</AttributeName> | |
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(0)>]</AttributeName> | |
</Attribute> | |
</Attributes> | |
<ReturnValue> | |
<ReturnType>System.Void</ReturnType> | |
</ReturnValue> | |
<Parameters> | |
<Parameter Name="buffer" Type="System.ReadOnlySpan<System.Byte>" Index="0" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0;net-6.0;net-7.0;net-8.0" /> | |
</Parameters> | |
<Docs> | |
<param name="buffer">The span of bytes to write.</param> | |
<summary>Writes a span of bytes to the current stream.</summary> | |
<remarks>To be added.</remarks> | |
</Docs> | |
</Member> |
Metadata
Metadata
Assignees
Labels
📚 documentationPri3Indicates issues/PRs that are low priorityIndicates issues/PRs that are low priorityarea-System.IOdoc-bugProblem with the content; needs to be fixedProblem with the content; needs to be fixeddocumentation