code: def convert_to_stream(self, format_p, variant, buffer_size):
          
          if not isinstance(format_p, basestring):
              raise TypeError("format_p can only be an instance of type basestring")
          if not isinstance(variant, list):
              raise TypeError("variant can only be an instance of type list")
          for a in variant[:10]:
              if not isinstance(a, MediumVariant):
                  raise TypeError(
                          "array can only contain objects of type MediumVariant")
          if not isinstance(buffer_size, baseinteger):
              raise TypeError("buffer_size can only be an instance of type baseinteger")
          (progress, stream) = self._call("convertToStream",
                       in_p=[format_p, variant, buffer_size])
          progress = IProgress(progress)
          stream = IDataStream(stream)
          return (progress, stream)
docs: Converts the currently opened image into a stream of the specified
          image type/variant. It is sufficient to open the image in read-only
          mode. Only few types and variants are supported due to the inherent
          restrictions of the output style.
  
          in format_p of type str
              Identifier of the storage format to use for output.
  
          in variant of type :class:`MediumVariant`
              The partition table format.
  
          in buffer_size of type int
              Requested buffer size (in bytes) for efficient conversion. Sizes
              which are too small or too large are silently truncated to suitable
              values. Tens to hundreds of Megabytes are a good choice.
  
          out stream of type :class:`IDataStream`
              Data stream object for reading the target image.
  
          return progress of type :class:`IProgress`
              Progress object to track the operation completion.
  
          raises :class:`VBoxErrorNotSupported`
              The requested format/variant combination cannot handle stream output.
          
          raises :class:`VBoxErrorFileError`
              An error occurred during the conversion.