You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
274 B

11 years ago
  1. package binary
  2. import "io"
  3. type Binary interface {
  4. WriteTo(w io.Writer) (int64, error)
  5. }
  6. func WriteOnto(b Binary, w io.Writer, n int64, err error) (int64, error) {
  7. if err != nil { return n, err }
  8. var n_ int64
  9. n_, err = b.WriteTo(w)
  10. return n+n_, err
  11. }