mapserver/mapblockparser/countedreader.go
Thomas Rudin bc223722af gofmt
2019-01-13 16:37:03 +01:00

23 lines
334 B
Go

package mapblockparser
import (
"bytes"
)
type CountedReader struct {
Reader *bytes.Reader
Count int
}
func (r *CountedReader) Read(p []byte) (int, error) {
i, err := r.Reader.Read(p)
r.Count += i
return i, err
}
func (r *CountedReader) ReadByte() (byte, error) {
i, err := r.Reader.ReadByte()
r.Count++
return i, err
}