github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/internal/cov/mreader.go (about) 1 // Copyright 2022 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package cov 6 7 import ( 8 "github.com/shogo82148/std/cmd/internal/bio" 9 "github.com/shogo82148/std/os" 10 ) 11 12 type MReader struct { 13 f *os.File 14 rdr *bio.Reader 15 fileView []byte 16 off int64 17 } 18 19 func NewMreader(f *os.File) (*MReader, error) 20 21 func (r *MReader) Read(p []byte) (int, error) 22 23 func (r *MReader) ReadByte() (byte, error) 24 25 func (r *MReader) Seek(offset int64, whence int) (int64, error)