in proprot/src/com/amazonaws/proprot/Header.java [82:106]
private void verifyAddressSize(byte[] address) {
// CHECKSTYLE:ON
int addressLength = address.length;
switch (addressFamily) {
case AF_UNSPEC:
case AF_INET:
case AF_INET6:
if (addressLength != addressFamily.getAddressSize()) {
throw new InvalidHeaderException("For the address family " + addressFamily +
" expected address size " + addressFamily.getAddressSize() + " but got "
+ addressLength + " for the address "
+ BaseEncoding.base16().lowerCase().encode(address));
}
break;
case AF_UNIX:
// Unix address can be smaller than the reserved space
if (addressLength > addressFamily.getAddressSize()
|| addressLength == 0) {
throw new InvalidHeaderException("Invalid size " + addressLength +
" of the Unix address "
+ BaseEncoding.base16().lowerCase().encode(address));
}
break;
}
}