mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Throw IllegalArgumentException in ConstantSizeMarshaller.writeSize(), if provided size is not equal to the constant size
This commit is contained in:
+4
@@ -59,6 +59,10 @@ public final class ConstantSizeMarshaller implements SizeMarshaller {
|
||||
|
||||
@Override
|
||||
public void writeSize(Bytes out, long sizeToWrite) {
|
||||
if (sizeToWrite != constantSize) {
|
||||
throw new IllegalArgumentException(
|
||||
"sizeToWrite: " + sizeToWrite + ", constant size should be: " + constantSize);
|
||||
}
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user