Skip to content

Incorrect comment on BinaryWriter.Write(string) #37158

@mcpiroman

Description

@mcpiroman

Comment says:

 // Writes a length-prefixed string to this stream in the BinaryWriter's
 // current Encoding. This method first writes the length of the string as
 // a four-byte unsigned integer, and then writes that many characters
 // to the stream.
 //
 public virtual unsafe void Write(string value)

But the length is actually written as a packed (variable length) integer:

I'm not sure if it's just local comment or if it's included in public docs, so I report this just in case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.IOhelp wanted[up-for-grabs] Good issue for external contributorsuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions