File: util.go

package info (click to toggle)
golang-github-dhowett-go-plist 0.0~git20160708.0.fec78c8-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 280 kB
  • ctags: 251
  • sloc: makefile: 2
file content (18 lines) | stat: -rw-r--r-- 263 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package plist

import "io"

type countedWriter struct {
	io.Writer
	nbytes int
}

func (w *countedWriter) Write(p []byte) (int, error) {
	n, err := w.Writer.Write(p)
	w.nbytes += n
	return n, err
}

func (w *countedWriter) BytesWritten() int {
	return w.nbytes
}