use*_*031 6 struct go

// NewReaderSize returns a new Reader whose buffer has at least the specified
43  // size. If the argument io.Reader is already a Reader with large enough
44  // size, it returns the underlying Reader.
45  func NewReaderSize(rd io.Reader, size int) *Reader {
46      // Is it already a Reader?
47      b, ok := rd.(*Reader)
48      if ok && len(b.buf) >= size {
49          return b
50      }
51      if size < minReadBufferSize {
52          size = minReadBufferSize
53      }
54      r := new(Reader)
55      r.reset(make([]byte, size), rd)
56      return r
57  }

当我使用 os.Open 打开文件时

dictFile, err := os.Open(file)

我要将 dicFile 传递给

reader := bufio.NewReader(dictFile)
NewReaderSizerd.(*Reader)ReaderbufioReaderrd.(*Reader)