parameters: (self, block_id)
return_statement: return datablock.payload
docstring: reads the data of block block_id.
  
          if necessary, the metadata info in self.blockvalues and
          self.blockoffsets is updated.
  
          returns the block data.
docstring_summary: reads the data of block block_id.
docstring_tokens: reads the data of block block_id .
function: def read_block_data(self, block_id):
          """
          reads the data of block block_id.
  
          if necessary, the metadata info in self.blockvalues and
          self.blockoffsets is updated.
  
          returns the block data.
          """
          if block_id >= self.blockcount:
              raise EOFError()
  
          while block_id >= len(self.blockoffsets):
              # We do not yet know where the block starts. Seek forwards.
  
              # read info for the rightmost known block to get its size.
              offset = self.blockoffsets[-1]
              self.fileobj.seek(self.blockoffsets[-1])
              datablock = CFData.read(self.fileobj)
  
              # add starting position of next block to metadata.
              self.next_block_size(datablock.cbData)
  
          # we now know the starting position of the block.
          offset = self.blockoffsets[block_id]
          self.fileobj.seek(offset)
          datablock = CFData.read(self.fileobj)
          datablock.reserved = read_guaranteed(self.fileobj, self.blockreserved)
          datablock.payload = read_guaranteed(self.fileobj, datablock.cbData)
  
          # verify the datablock's checksum.
          datablock.verify_checksum()
  
          # add starting data of next block to metadata, if required.
          if block_id + 1 == len(self.blockoffsets):
              self.next_block_size(datablock.cbData)
  
          # finally, return the data.
          return datablock.payload
function_tokens: def read_block_data ( self , block_id ) : if block_id >= self . blockcount : raise EOFError ( ) while block_id >= len ( self . blockoffsets ) : # We do not yet know where the block starts. Seek forwards. # read info for the rightmost known block to get its size. offset = self . blockoffsets [ - 1 ] self . fileobj . seek ( self . blockoffsets [ - 1 ] ) datablock = CFData . read ( self . fileobj ) # add starting position of next block to metadata. self . next_block_size ( datablock . cbData ) # we now know the starting position of the block. offset = self . blockoffsets [ block_id ] self . fileobj . seek ( offset ) datablock = CFData . read ( self . fileobj ) datablock . reserved = read_guaranteed ( self . fileobj , self . blockreserved ) datablock . payload = read_guaranteed ( self . fileobj , datablock . cbData ) # verify the datablock's checksum. datablock . verify_checksum ( ) # add starting data of next block to metadata, if required. if block_id + 1 == len ( self . blockoffsets ) : self . next_block_size ( datablock . cbData ) # finally, return the data. return datablock . payload