Verifies that the given length looks like a reasonable array length. This method does not accept 0 as a valid length. @param buf The buffer from which the length was read. @param length The length to validate. @throws IllegalArgumentException if the length is zero, negative or suspiciously large.
(final ChannelBuffer buf,
final long length)
| 1074 | * suspiciously large. |
| 1075 | */ |
| 1076 | static void checkNonEmptyArrayLength(final ChannelBuffer buf, |
| 1077 | final long length) { |
| 1078 | if (length == 0) { |
| 1079 | throw new IllegalArgumentException("Read zero-length byte array " |
| 1080 | + " in buf=" + buf + '=' + Bytes.pretty(buf)); |
| 1081 | } |
| 1082 | checkArrayLength(buf, length); |
| 1083 | } |
| 1084 | |
| 1085 | /** |
| 1086 | * Reads a byte array. |
no test coverage detected