goadb/wire/util.go
Zach Klippenstein 4b9891533a Started host and local service clients.
Milestone: the demo app prints /proc/loadavg from the device.
2015-04-12 22:07:12 -07:00

17 lines
264 B
Go

package wire
import "io"
// writeFully writes all of data to w.
// Inverse of io.ReadFully().
func writeFully(w io.Writer, data []byte) error {
for len(data) > 0 {
n, err := w.Write(data)
if err != nil {
return err
}
data = data[n:]
}
return nil
}