I have a class constructor like this:
public JavoImageCorrectedDataHeader()
{
ByteBuffer buffer = ByteBuffer.allocate(this.size());
buffer.order(java.nio.ByteOrder.LITTLE_ENDIAN);
setByteBuffer(buffer, 0);
System.out.println("buffer.hasCode=" + buffer.hashCode());
}
In my other classes, I create many instances of above class in different locations and time by using
new JavoImageCorrectedDataHeader()
Then, I expected it will print out different hashCode for them. but I actually see the same hashCode is print out:
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
buffer.hasCode=1742602241
I must miss something about how to use the ByteBuffer.