You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2014/01/27 17:27:10 UTC
svn commit: r1561727 -
/hbase/branches/0.96/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java
Author: stack
Date: Mon Jan 27 16:27:10 2014
New Revision: 1561727
URL: http://svn.apache.org/r1561727
Log:
HBASE-10422 ZeroCopyLiteralByteString.zeroCopyGetBytes has an unusable prototype and conflicts with AsyncHBase
Modified:
hbase/branches/0.96/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java
Modified: hbase/branches/0.96/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java?rev=1561727&r1=1561726&r2=1561727&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java (original)
+++ hbase/branches/0.96/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java Mon Jan 27 16:27:10 2014
@@ -57,7 +57,12 @@ public final class ZeroCopyLiteralByteSt
* @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());
}
+
}