seaweedfs/weed/storage/needle_byte_cache.go

12 lines
232 B
Go
Raw Normal View History

package storage
import (
"os"
)
2017-06-04 02:44:24 +08:00
func getBytesForFileBlock(r *os.File, offset int64, readSize int) (dataSlice []byte, err error) {
dataSlice = make([]byte, readSize)
2016-04-18 03:03:45 +08:00
_, err = r.ReadAt(dataSlice, offset)
2017-06-04 02:44:24 +08:00
return dataSlice, err
}