Reads a byte array. @param buf The buffer from which to read the array. @return A possibly empty but guaranteed non-null byte array. @throws IllegalArgumentException if the length we read for the byte array is out of reasonable bounds.
(final ChannelBuffer buf)
| 1090 | * is out of reasonable bounds. |
| 1091 | */ |
| 1092 | static byte[] readByteArray(final ChannelBuffer buf) { |
| 1093 | final long length = readVLong(buf); |
| 1094 | checkArrayLength(buf, length); |
| 1095 | final byte[] b = new byte[(int) length]; |
| 1096 | buf.readBytes(b); |
| 1097 | return b; |
| 1098 | } |
| 1099 | |
| 1100 | /** |
| 1101 | * Reads a string encoded by {@code hadoop.io.WritableUtils#readString}. |
no test coverage detected