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

Method readByteArray

src/HBaseRpc.java:1092–1098  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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}.

Calls 2

readVLongMethod · 0.95
checkArrayLengthMethod · 0.95

Tested by

no test coverage detected