(self, fh, length)
return buf
readExactly

        Reads exactly length bytes and throws an exception if EOF is hitten
        before.
readExactly
readExactly
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
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