seaweedfs/weed/storage/needle_byte_cache.go
2017-06-03 11:44:24 -07:00

12 lines
232 B
Go

package storage
import (
"os"
)
func getBytesForFileBlock(r *os.File, offset int64, readSize int) (dataSlice []byte, err error) {
dataSlice = make([]byte, readSize)
_, err = r.ReadAt(dataSlice, offset)
return dataSlice, err
}