mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-27 08:55:22 -04:00
Moved ByteArray to P2PDataStorage class
This commit is contained in:
parent
245d41f07d
commit
7cdb779aae
3 changed files with 40 additions and 40 deletions
|
@ -1,33 +0,0 @@
|
|||
package io.bitsquare.common;
|
||||
|
||||
import io.bitsquare.app.Version;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
// Util for comparing byte arrays
|
||||
public final class ByteArray implements Serializable {
|
||||
// That object is sent over the wire, so we need to take care of version compatibility.
|
||||
private static final long serialVersionUID = Version.P2P_NETWORK_VERSION;
|
||||
|
||||
public final byte[] bytes;
|
||||
|
||||
public ByteArray(byte[] bytes) {
|
||||
this.bytes = bytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ByteArray)) return false;
|
||||
|
||||
ByteArray byteArray = (ByteArray) o;
|
||||
|
||||
return Arrays.equals(bytes, byteArray.bytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return bytes != null ? Arrays.hashCode(bytes) : 0;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue