This commit is contained in:
Jae Kwon
2014-07-01 14:50:24 -07:00
parent fa07748d23
commit c40fc65e6b
41 changed files with 3176 additions and 2938 deletions

View File

@ -3,12 +3,14 @@ package binary
import "io"
type Binary interface {
WriteTo(w io.Writer) (int64, error)
WriteTo(w io.Writer) (int64, error)
}
func WriteOnto(b Binary, w io.Writer, n int64, err error) (int64, error) {
if err != nil { return n, err }
var n_ int64
n_, err = b.WriteTo(w)
return n+n_, err
if err != nil {
return n, err
}
var n_ int64
n_, err = b.WriteTo(w)
return n + n_, err
}