public long read(long pos, Iterable<ByteBuffer> bufs) {
    if (pos >= size()) {
      return -1;
    }

    long start = pos;
    for (ByteBuffer buf : bufs) {
      int read = read(pos, buf);
      if (read == -1) {
        break;
      } else {
        pos += read;
      }
    }

    return pos - start;
  }
Reads up to the total {@code remaining()} number of bytes in each of {@code bufs} starting at
position {@code pos} in this file to the given buffers, in order. Returns the number of bytes
read or -1 if {@code pos} is greater than or equal to the size of this file.
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java