summaryrefslogtreecommitdiff
path: root/vendor/github.com/tdewolff/parse/v2/binary.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/tdewolff/parse/v2/binary.go')
-rw-r--r--vendor/github.com/tdewolff/parse/v2/binary.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/github.com/tdewolff/parse/v2/binary.go b/vendor/github.com/tdewolff/parse/v2/binary.go
index c412bd997..7247e6e10 100644
--- a/vendor/github.com/tdewolff/parse/v2/binary.go
+++ b/vendor/github.com/tdewolff/parse/v2/binary.go
@@ -574,6 +574,16 @@ func (r *BinaryReader2) Read(b []byte) (int, error) {
return n, err
}
+// ReadAt complies with io.ReaderAt.
+func (r *BinaryReader2) ReadAt(b []byte, off int64) (int, error) {
+ data, err := r.f.Bytes(len(b), off)
+ if err != nil && err != io.EOF {
+ return 0, err
+ }
+ n := copy(b, data)
+ return n, err
+}
+
// ReadBytes reads n bytes.
func (r *BinaryReader2) ReadBytes(n int) []byte {
data, err := r.f.Bytes(n, r.pos)