Skip to content

bufio: no way to give/take underlying buffers #5100

@bradfitz

Description

@bradfitz
bytes.Buffer has a way to create a byte buffer from a given buffer (bytes.NewBuffer) and
a way to take an existing Buffer's []byte back out (bytes.(*Buffer).Bytes).

bufio has neither of those.

In tuning the HTTP server code in https://golang.org/cl/7799047/ I had to go to
great efforts to re-use bufio Readers and Writers, since I couldn't simplify re-use
their underlying buffers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions