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

Method readHadoopString

src/HBaseRpc.java:1105–1111  ·  view source on GitHub ↗

Reads a string encoded by hadoop.io.WritableUtils#readString. @throws IllegalArgumentException if the length we read for the string is out of reasonable bounds.

(final ChannelBuffer buf)

Source from the content-addressed store, hash-verified

1103 * is out of reasonable bounds.
1104 */
1105 static String readHadoopString(final ChannelBuffer buf) {
1106 final int length = buf.readInt();
1107 checkArrayLength(buf, length);
1108 final byte[] s = new byte[length];
1109 buf.readBytes(s);
1110 return new String(s, CharsetUtil.UTF_8);
1111 }
1112
1113 /**
1114 * De-serializes a protobuf from the given buffer.

Calls 1

checkArrayLengthMethod · 0.95

Tested by

no test coverage detected