# encoding: utf-8

import abc

import six

from .._table_writer import AbstractTableWriter


@six.add_metaclass(abc.ABCMeta)
class BinaryWriterInterface(object):
    @abc.abstractmethod
    def is_opened(self):  # pragma: no cover
        pass

    @abc.abstractmethod
    def open(self, file_path):  # pragma: no cover
        pass


class AbstractBinaryTableWriter(AbstractTableWriter, BinaryWriterInterface):
    def dumps(self):
        raise NotImplementedError("binary format writers did not support dumps method")

@@ -514,8 +514,155 @@
 ethod%22)%0A
+%0A    def _verify_stream(self):%0A        if self.stream is None:%0A            raise IOError(%22null output stream. required to open(file_path) first.%22)%0A

Add stream verification for binary format writers