You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
232 B

  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. }