':param data: bytes to write to file or buffer
:type data: bytes
:param size: buffer at least size bytes before writing to file
:type size: int'

def write(self, data, size=(-1)):

    if (not size):
        size = self._size
    if ((self._len + len(data)) <= size):
        self._write_buffer(data)
    else:
        self._write_gzip(data)
