c# – Other than the intent, is there a difference in how you implement Chain of Responsibility and Decorator Pattern?

I think it’s fair to say that they are quite similar to each other.
The only difference that I know is the intent.

Chain of Responsibility: Avoid coupling between the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it. Not all objects may get chance or be able to handle the request.

Decorator : Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to sub-classing for extending functionality. All decorator objects handle the request by enhancing the data in their own way.

But is there a difference if implementation? Apart from the fact that in Chain of responsibility you could break the chain at any point?

The following is an example of Decorator Pattern. But if you had asked me to write an example of Chain of responsibility, I could have written the same example.

Yes, I could have also added the condition where I check if the request is to be forwarded further and then break the chain, if not. But is that a mandatory thing for it to qualify as a Chain of Responsibility Pattern?

If it’s not then doesn’t the following serves as an example of both Chain of Responsibility and Decorator pattern? Does chain of responsibility differ only by an extra if condition that check if it is to be forwarded? Or is there more to it?

public interface IStream
{
    void write(string data);
}

public class CloudStream : IStream
{
    public void write(string data)
    {
        Console.WriteLine("Writing to cloud storage..");
    }

}
public class EncryptStream : IStream
{
    private IStream stream { get; set; }

    public EncryptStream(IStream stream)
    {
        this.stream = stream;
    }

    public void write(string data)
    {
        Console.WriteLine("Encrypting stream..");
        var encryptedData = Encrypt(data);
        this.stream.write(data);
    }

    private object Encrypt(string data)
    {
        return data; // return encrypted data
    }
}

public class CompressStream : IStream
{
    private IStream stream { get; set; }

    public CompressStream(IStream stream)
    {
        this.stream = stream;
    }

    public void write(string data)
    {
        var compressedData = Compress(data);
        Console.WriteLine("Compressing stream..");
        this.stream.write(data);
    }

    private object Compress(string data)
    {
        return data;
    }
}