Throw IllegalArgumentException in ConstantSizeMarshaller.writeSize(), if provided size is not equal to the constant size

This commit is contained in:
leventov
2017-06-04 11:52:30 -05:00
parent 88da33fc10
commit 5c8c50ba6b
@@ -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
}