public final class ProtobufUtil extends Object
Modifier and Type | Field and Description |
---|---|
static byte[] |
PB_MAGIC
Magic we put ahead of a serialized protobuf message.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isPBMagicPrefix(byte[] bytes) |
static int |
lengthOfPBMagic() |
static byte[] |
prependPBMagic(byte[] bytes)
Prepend the passed bytes with four bytes of magic,
PB_MAGIC , to flag what
follows as a protobuf in hbase. |
public static final byte[] PB_MAGIC
public static byte[] prependPBMagic(byte[] bytes)
PB_MAGIC
, to flag what
follows as a protobuf in hbase. Prepend these bytes to all content written to znodes, etc.bytes
- Bytes to decoratebytes with magic prepended (Creates a new
byte array that is bytes.length
plus PB_MAGIC
.length.
public static boolean isPBMagicPrefix(byte[] bytes)
bytes
- Bytes to check.bytes
has PB_MAGIC
for a prefix.public static int lengthOfPBMagic()
PB_MAGIC
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.