]> Cypherpunks repositories - gostls13.git/commit
Add ReadFrom and WriteTo methods to bytes.Buffer, to enable i/o without buffer alloca...
authorRob Pike <r@golang.org>
Thu, 3 Dec 2009 20:56:16 +0000 (12:56 -0800)
committerRob Pike <r@golang.org>
Thu, 3 Dec 2009 20:56:16 +0000 (12:56 -0800)
commitbc3e34759c7d3f6625df9dd5ded40f6404c91324
treece07c7a46dbc7f8891da57b8902a25eb24ac6ac5
parent7e7008fa5e96cf0418b71b5b408ea2a69b522221
Add ReadFrom and WriteTo methods to bytes.Buffer, to enable i/o without buffer allocation.
Use them in Copy and Copyn.
Speed up ReadFile by using ReadFrom and avoiding Copy altogether (a minor win).

R=rsc, gri
CC=golang-dev
https://golang.org/cl/166041
src/pkg/bytes/buffer.go
src/pkg/bytes/buffer_test.go
src/pkg/io/io.go
src/pkg/io/io_test.go [new file with mode: 0644]
src/pkg/io/ioutil/ioutil.go