Amend HBASE-18026 ProtobufUtil seems to do extra array copying

If the ByteString is not a LiteralByteString, just do toByteArray().

Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
Vincent 2017-05-14 19:26:15 -07:00 committed by Andrew Purtell
parent 292226690a
commit d8ef495063
1 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ public final class HBaseZeroCopyByteString extends LiteralByteString {
if (buf instanceof LiteralByteString) {
return ((LiteralByteString) buf).bytes;
}
throw new UnsupportedOperationException("Need a LiteralByteString, got a "
+ buf.getClass().getName());
// In case it's BoundedByteString
return buf.toByteArray();
}
}