needle_byte_cache.go 232 B

1234567891011
  1. package storage
  2. import (
  3. "os"
  4. )
  5. func getBytesForFileBlock(r *os.File, offset int64, readSize int) (dataSlice []byte, err error) {
  6. dataSlice = make([]byte, readSize)
  7. _, err = r.ReadAt(dataSlice, offset)
  8. return dataSlice, err
  9. }