seaweedfs/weed/storage/needle_byte_cache.go

12 lines
232 B
Go
Raw Normal View History

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