public function writeByteStream(Stream $stream, Stream $value)
    {
        $length = $value->getSize();

        $value->seek(0);
        $this->writeVarint($stream, $length);
        $stream->writeStream($value, $length);
    }