def readRegions(regions)
      piece = ""
      regions.each do |region|
        # Get the IO for the file with path 'path'. If we are being used in a reactor, this is the IO facade. If we
        # are not then this is a real IO.
        io = @ioManager.get(region.path)
        if ! io
          # No IO for this file. 
          if ! File.exists?(region.path)
            # This file hasn't been created yet by having blocks written to it.
            piece = nil
            break
          end

          raise "This process doesn't have read permission for the file #{region.path}" if ! File.readable?(region.path)

          begin
            io = @ioManager.open(region.path)
          rescue
            @logger.error "Opening file #{region.path} failed: #{$!}"
            raise "Opening file #{region.path} failed"
          end
        end
        io.seek region.offset, IO::SEEK_SET
        begin
          piece << io.read(region.length)
        rescue
          # Error when reading. Likely EOF, meaning this peice isn't all there yet.
          piece = nil
          break
        end
      end
      piece
    end
def readRegions(regions)
      piece = ""
      regions.each do |region|
        # Get the IO for the file with path 'path'. If we are being used in a reactor, this is the IO facade. If we
        # are not then this is a real IO.
        io = @ioManager.get(region.path)
        if ! io
          # No IO for this file. 
          if ! File.exists?(region.path)
            # This file hasn't been created yet by having blocks written to it.
            piece = nil
            break
          end

          raise "This process doesn't have read permission for the file #{region.path}" if ! File.readable?(region.path)

          begin
            io = @ioManager.open(region.path)
          rescue
            @logger.error "Opening file #{region.path} failed: #{$!}"
            raise "Opening file #{region.path} failed"
          end
        end
        io.seek region.offset, IO::SEEK_SET
        begin
          piece << io.read(region.length)
        rescue
          # Error when reading. Likely EOF, meaning this peice isn't all there yet.
          piece = nil
          break
        end
      end
      piece
    end
Pass an ordered list of FileRegions to load.