def write()

in amazon_transcribe/structures.py [0:0]


    def write(self, b: "ReadableBuffer") -> int:
        if not isinstance(b, bytes):
            type_ = type(b)
            raise ValueError(
                f"Unexpected value written to BufferableByteStream. "
                f"Only bytes are support but {type_} was provided."
            )

        if self.closed or self.__done:
            raise IOError("Stream is completed and doesn't support further writes.")

        if b:
            self._byte_chunks.append(b)

        return len(b)