use of org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream in project hbase by apache.
the class ProtobufUtil method mergeFrom.
/**
* This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding
* buffers when working with ByteStrings
* @param builder current message builder
* @param bs ByteString containing the
* @throws IOException
*/
public static void mergeFrom(Message.Builder builder, ByteString bs) throws IOException {
final CodedInputStream codedInput = bs.newCodedInput();
codedInput.setSizeLimit(bs.size());
builder.mergeFrom(codedInput);
codedInput.checkLastTagWas(0);
}
use of org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream in project hbase by apache.
the class ProtobufUtil method mergeFrom.
/**
* This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding
* buffers when working with byte arrays
* @param builder current message builder
* @param b byte array
* @throws IOException
*/
public static void mergeFrom(Message.Builder builder, byte[] b) throws IOException {
final CodedInputStream codedInput = CodedInputStream.newInstance(b);
codedInput.setSizeLimit(b.length);
builder.mergeFrom(codedInput);
codedInput.checkLastTagWas(0);
}
use of org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream in project hbase by apache.
the class ProtobufUtil method mergeFrom.
/**
* This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding
* buffers when working with byte arrays
* @param builder current message builder
* @param b byte array
* @param offset
* @param length
* @throws IOException
*/
public static void mergeFrom(Message.Builder builder, byte[] b, int offset, int length) throws IOException {
final CodedInputStream codedInput = CodedInputStream.newInstance(b, offset, length);
codedInput.setSizeLimit(length);
builder.mergeFrom(codedInput);
codedInput.checkLastTagWas(0);
}
use of org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream in project hbase by apache.
the class ProtobufUtil method mergeFrom.
/**
* This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding
* buffers where the message size is known
* @param builder current message builder
* @param in InputStream containing protobuf data
* @param size known size of protobuf data
* @throws IOException
*/
public static void mergeFrom(Message.Builder builder, InputStream in, int size) throws IOException {
final CodedInputStream codedInput = CodedInputStream.newInstance(in);
codedInput.setSizeLimit(size);
builder.mergeFrom(codedInput);
codedInput.checkLastTagWas(0);
}
use of org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream in project hbase by apache.
the class ProtobufUtil method mergeFrom.
/**
* This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding
* buffers where the message size is not known
* @param builder current message builder
* @param in InputStream containing protobuf data
* @throws IOException
*/
public static void mergeFrom(Message.Builder builder, InputStream in) throws IOException {
final CodedInputStream codedInput = CodedInputStream.newInstance(in);
codedInput.setSizeLimit(Integer.MAX_VALUE);
builder.mergeFrom(codedInput);
codedInput.checkLastTagWas(0);
}
Aggregations