utf8: make EncodeRune's destination the first argument.

R=r
CC=golang-dev
https://golang.org/cl/3364041
diff --git a/src/pkg/bytes/buffer.go b/src/pkg/bytes/buffer.go
index 6f93869..b4ad95f 100644
--- a/src/pkg/bytes/buffer.go
+++ b/src/pkg/bytes/buffer.go
@@ -172,7 +172,7 @@
 		b.WriteByte(byte(r))
 		return 1, nil
 	}
-	n = utf8.EncodeRune(r, b.runeBytes[0:])
+	n = utf8.EncodeRune(b.runeBytes[0:], r)
 	b.Write(b.runeBytes[0:n])
 	return n, nil
 }
diff --git a/src/pkg/bytes/buffer_test.go b/src/pkg/bytes/buffer_test.go
index 1ba7749..a95068a 100644
--- a/src/pkg/bytes/buffer_test.go
+++ b/src/pkg/bytes/buffer_test.go
@@ -272,7 +272,7 @@
 	var buf Buffer
 	n := 0
 	for r := 0; r < NRune; r++ {
-		size := utf8.EncodeRune(r, b[n:])
+		size := utf8.EncodeRune(b[n:], r)
 		nbytes, err := buf.WriteRune(r)
 		if err != nil {
 			t.Fatalf("WriteRune(0x%x) error: %s", r, err)
@@ -291,7 +291,7 @@
 
 	// Read it back with ReadRune
 	for r := 0; r < NRune; r++ {
-		size := utf8.EncodeRune(r, b)
+		size := utf8.EncodeRune(b, r)
 		nr, nbytes, err := buf.ReadRune()
 		if nr != r || nbytes != size || err != nil {
 			t.Fatalf("ReadRune(0x%x) got 0x%x,%d not 0x%x,%d (err=%s)", r, nr, nbytes, r, size, err)
diff --git a/src/pkg/bytes/bytes.go b/src/pkg/bytes/bytes.go
index e26b29f..d074987 100644
--- a/src/pkg/bytes/bytes.go
+++ b/src/pkg/bytes/bytes.go
@@ -347,7 +347,7 @@
 				copy(nb, b[0:nbytes])
 				b = nb
 			}
-			nbytes += utf8.EncodeRune(rune, b[nbytes:maxbytes])
+			nbytes += utf8.EncodeRune(b[nbytes:maxbytes], rune)
 		}
 		i += wid
 	}