dotnet / dotnet/dotnet-api-docs
StreamReader constructor argument bufferSize: wrong explanation in Remarks section
- Lingua principale
- C#
- Stelle
- 949
- Fork
- 1.7k
- Merge medio
- 2g 19h
- PR unite (30g)
- 52
Descrizione
It seems that the _Remarks_ section explaining the _bufferSize_ argument used by StreamReader constructors is incorrect:
> The buffer size, in number of 16-bit characters, is set by the bufferSize parameter. If bufferSize is less than the minimum allowable size (128 characters), the minimum allowable size is used.
When looking at the referenc source code (here: https://referencesource.microsoft.com/mscorlib/R/c97df3321103c3ac.html), it looks to me that _bufferSize_ defines the buffer size not in number of 16-bit characters, but rather **in bytes**. In the same manner, the minimum buffer size is not 128 characters, but rather 128 bytes.
(The buffer size in number of 16-bit characters would then be _bufferSize/2_, if i am not mistaken.)
---
#### Document details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: 08694de5-3960-b1ad-681c-0b666747f6a7
* Version Independent ID: 2edeccd6-6ad0-e708-3d0e-23901a54028d
* Content: [StreamReader Constructor (System.IO)](https://docs.microsoft.com/en-gb/dotnet/api/system.io.streamreader.-ctor?view=netframework-4.7.2#System_IO_StreamReader__ctor_System_IO_Stream_System_Text_Encoding_System_Boolean_System_Int32_)
* Content Source: [xml/System.IO/StreamReader.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.IO/StreamReader.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Apri xml/System.IO/StreamReader.xml ed esamina il testo di Remarks per il parametro bufferSize, quindi confrontalo con l'implementazione di StreamReader a cui si fa riferimento. Aggiorna la formulazione in modo da descrivere accuratamente l'unità e la dimensione minima e verifica che la documentazione del costruttore corrisponda chiaramente al comportamento del codice sorgente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 55/100