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:
Michael Stack 2014-01-27 16:26:41 +00:00
parent 2dedc95c9e
commit b50cc05367
1 changed files with 7 additions and 2 deletions

View File

@ -57,7 +57,12 @@ public final class ZeroCopyLiteralByteString extends LiteralByteString {
* @param buf A buffer from which to extract the array. This buffer must be
* actually an instance of a {@code LiteralByteString}.
*/
public static byte[] zeroCopyGetBytes(final LiteralByteString buf) {
return buf.bytes;
public static byte[] zeroCopyGetBytes(final ByteString buf) {
if (buf instanceof LiteralByteString) {
return ((LiteralByteString) buf).bytes;
}
throw new UnsupportedOperationException("Need a LiteralByteString, got a "
+ buf.getClass().getName());
}
}