def read(self, size=None):
if size is None:<EOL><INDENT>self.temporary_file.seek(<NUM_LIT:0>)<EOL>data = self.temporary_file.read()<EOL>self.temporary_file.seek(<NUM_LIT:0>)<EOL>return data<EOL><DEDENT>else:<EOL><INDENT>if not (isinstance(size, int) and size > <NUM_LIT:0>):<EOL><INDENT>raise securesystemslib.exceptions.FormatError<EOL><DEDENT>return self.temporary_file.read(size)<EOL><DEDENT>
<Purpose>
  Read specified number of bytes.  If size is not specified then the whole
  file is read and the file pointer is placed at the beginning of the file.

<Arguments>
  size:
    Number of bytes to be read.

<Exceptions>
  securesystemslib.exceptions.FormatError: if 'size' is invalid.

<Return>
  String of data.