def OverwriteAndClose(self, compressed_data, size):
    """Directly overwrite the current contents.

    Replaces the data currently in the stream with compressed_data,
    and closes the object. Makes it possible to avoid recompressing
    the data.
    Args:
      compressed_data: The data to write, must be zlib compressed.
      size: The uncompressed size of the data.
    """
    self.Set(self.Schema.CONTENT(compressed_data))
    self.Set(self.Schema.SIZE(size))
    super(AFF4MemoryStreamBase, self).Close()