HBASE-10422 ZeroCopyLiteralByteString.zeroCopyGetBytes has an unusable prototype and conflicts with AsyncHBase
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1561725 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2dedc95c9e
commit
b50cc05367
|
@ -57,7 +57,12 @@ public final class ZeroCopyLiteralByteString extends LiteralByteString {
|
||||||
* @param buf A buffer from which to extract the array. This buffer must be
|
* @param buf A buffer from which to extract the array. This buffer must be
|
||||||
* actually an instance of a {@code LiteralByteString}.
|
* actually an instance of a {@code LiteralByteString}.
|
||||||
*/
|
*/
|
||||||
public static byte[] zeroCopyGetBytes(final LiteralByteString buf) {
|
public static byte[] zeroCopyGetBytes(final ByteString buf) {
|
||||||
return buf.bytes;
|
if (buf instanceof LiteralByteString) {
|
||||||
|
return ((LiteralByteString) buf).bytes;
|
||||||
|
}
|
||||||
|
throw new UnsupportedOperationException("Need a LiteralByteString, got a "
|
||||||
|
+ buf.getClass().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue