MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / checkNonEmptyArrayLength

Method checkNonEmptyArrayLength

src/HBaseRpc.java:1076–1083  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 6

parseResultsMethod · 0.95
fromBufferMethod · 0.95
decodeMultiResponseMethod · 0.95

Calls 2

prettyMethod · 0.95
checkArrayLengthMethod · 0.95

Tested by

no test coverage detected