package rx.broadcast;

import org.jetbrains.annotations.NotNull;

import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.Arrays;

public final class Sender implements Serializable, Comparable<Sender> {
    private static final long serialVersionUID = 114L;

    private ByteBuffer bytes;

    Sender(final byte[] bytes) {
        this.bytes = ByteBuffer.wrap(bytes);
    }

    @Override
    public final boolean equals(final Object o) {
        return this == o || !(o == null || getClass() != o.getClass()) && bytes.equals(((Sender) o).bytes);
    }

    @Override
    public final int hashCode() {
        return bytes.hashCode();
    }

    @Override
    public int compareTo(@NotNull final Sender o) {
        return bytes.compareTo(o.bytes);
    }

    @Override
    public String toString() {
        return "Sender{id=" + Arrays.toString(bytes.array()) + '}';
    }
}

@@ -59,16 +59,78 @@
 tNull;%0A%0A
+import java.io.IOException;%0Aimport java.io.ObjectInputStream;%0A
 import j
@@ -150,16 +150,16 @@
 izable;%0A
-
 import j
@@ -344,16 +344,64 @@
 private 
+final byte%5B%5D byteBuffer;%0A%0A    private transient 
 ByteBuff
@@ -440,24 +440,57 @@
 %5B%5D bytes) %7B%0A
+        this.byteBuffer = bytes;%0A
         this
@@ -951,24 +951,24 @@
 oString() %7B%0A
-
         retu
@@ -1028,11 +1028,201 @@
 ';%0A    %7D
+%0A%0A    private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException %7B%0A        in.defaultReadObject();%0A        this.bytes = ByteBuffer.wrap(byteBuffer);%0A    %7D
 %0A%7D%0A

Mark bytes field in Sender transient, keep ref to byte[] instead