parameters: (self, fh, length)
return_statement: return buf
docstring: readExactly
  
          Reads exactly length bytes and throws an exception if EOF is hitten
          before.
docstring_summary: readExactly
docstring_tokens: readExactly
function: def readExactly(self, fh, length):
          """readExactly
  
          Reads exactly length bytes and throws an exception if EOF is hitten
          before.
          """
          ## assert isinstance(fh, file)
          assert duck_typed(fh, 'read')  # duck typing
          buf = fh.read(length)
          if buf is None or len(buf) < length:
              raise EOFException('readExactly: %s' % str(fh))
          return buf
function_tokens: def readExactly ( self , fh , length ) : ## assert isinstance(fh, file) assert duck_typed ( fh , 'read' ) # duck typing buf = fh . read ( length ) if buf is None or len ( buf ) < length : raise EOFException ( 'readExactly: %s' % str ( fh ) ) return buf