Moved ByteArray to P2PDataStorage class

This commit is contained in:
Manfred Karrer 2016-02-18 13:23:37 +01:00
parent 245d41f07d
commit 7cdb779aae
3 changed files with 40 additions and 40 deletions

View file

@ -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;
}
}