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:
parent
292226690a
commit
d8ef495063
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue