()
| 357 | } |
| 358 | |
| 359 | func (this *FileReader) Close() error { |
| 360 | if this.isClosed { |
| 361 | return nil |
| 362 | } |
| 363 | this.isClosed = true |
| 364 | |
| 365 | if this.openFileCache != nil { |
| 366 | if this.openFile != nil { |
| 367 | this.openFileCache.Put(this.fp.Name(), this.openFile) |
| 368 | } else { |
| 369 | var cacheMeta = make([]byte, len(this.meta)) |
| 370 | copy(cacheMeta, this.meta) |
| 371 | this.openFileCache.Put(this.fp.Name(), NewOpenFile(this.fp.Raw(), cacheMeta, this.header, this.LastModified(), this.bodySize)) |
| 372 | } |
| 373 | return nil |
| 374 | } |
| 375 | |
| 376 | return this.fp.Close() |
| 377 | } |
| 378 | |
| 379 | func (this *FileReader) readToBuff(fp *fsutils.File, buf []byte) (ok bool, err error) { |
| 380 | n, err := fp.Read(buf) |
nothing calls this directly
no test coverage detected