增加 Seek 方法.

Signed-off-by: rick.chan <chenyang@autoai.com>
This commit is contained in:
rick.chan 2021-03-11 11:11:13 +08:00
parent 991717bf58
commit 7f0ac55978
1 changed files with 12 additions and 0 deletions

View File

@ -73,6 +73,18 @@ func (f *File) Read(b []byte) (n int, err error)
func (f *File) Write(b []byte) (n int, err error)
```
### 1.6.设置读写位置
```go
/**
* @param whence
* os.SEEK_SET: seek relative to the origin of the file
* os.SEEK_CUR: seek relative to the current offset
* os.SEEK_END: seek relative to the end
*/
func (f *File) Seek(offset int64, whence int) (ret int64, err error)
```
## 2.ioutil 包
### 2.1.读取